Commit Graph

380 Commits

Author SHA1 Message Date
Evgeny Lazarev
21d060ac2b Updated conversion of TF OD API 2.4 SSD models (#6473)
* Updated conversion of TF OD API 2.4 SSD models

* Fixed issue when more Conv2D nodes were selected for weights permutation when converting TF OD API models

* Code style fixes

* Fixed code comments
2021-07-02 17:35:59 +03:00
Svetlana Dolinina
ccf786438b Kaldi priors (#6258)
* add priors to loader and counts transformation

* fixes in select insertion for case with context gathering - LSTM - context gathering
fix for edge parallel to ReadValue
extend counts option to case of priors inside mdl model file

* fixed tests

* fixed typo

* fixed issue with input names

* fix priors loading + comments

* fix e2e test: error with not found transformation

* print debug info for dependency graph - should be reverted

* should be reverted: debug commit

* Revert "fix e2e test: error with not found transformation"

This reverts commit 8320fa99bf.

* revert debug commits

* fixes after review

* review fixes

* review change

* review changes
2021-07-02 15:18:23 +05:00
Mikhail Nosov
ae624ea18a [MO] Fix showing graceful error message when no ngraph case (#6379)
* [MO] Fix showing graceful error message when no ngraph case

Move frontend-related imports inside appropriate functions
And use try/except if import fails to show graceful error message

* Revert "[MO] Fix showing graceful error message when no ngraph case"

This reverts commit 72d52bd946.

* Print error before running of subprocess if IE or nGraph Python API is not found

* Added pytest to requirements_dev.txt

* Fixed review comment
2021-07-01 09:49:18 +03:00
Evgeny Lazarev
635ab37a86 MO now shows a hint when --disable_nhwc_to_nchw is needed (#6350)
* MO now shows a hint when --disable_nhwc_to_nchw is needed

* Updated message to be printed using log.error

* Small code refactoring
2021-06-25 12:12:52 +03:00
Yegor Kruglov
10e5936dee [MO] Fixes in Merge infer function (#6125)
* move output shape setting to the conditions

* e2e fix

* updated unittests
2021-06-24 18:53:13 +03:00
iliya mironov
7211cd3aa6 Fix transpose with reverse (#6234)
* Fix transpose with reverse

* Add unit test
2021-06-24 18:12:32 +03:00
Mikhail Nosov
d49405a0e8 [MO] Initial support of nGraph Frontend API (#6001)
* [NG Frontend] Introduce classes and macros for Frontend-specific exceptions

* [nGraph Frontend] Python bindings

Exposing Python API for nGraph FrontEndManager introduced in PR #5470

* Exposing 'Dimension' class to Python nGraph API

* Model optimizer code from pdpd_frontend

Removed 'use_legacy_frontend' option as not needed for PDPD integration

* Added XML/BIN prints for 'ngraph-FE' serialization path

* Update python bindings to latest code from PR #5995

* Add OV_FRONTEND_PATH to LD_LIBRARY_PATH by default for Model Optimizer

* Test with 'mock' frontend

* Added meta info to generated IR

Added more tests to cover currently supported scenarios
Clang config for MO mock frontend

* some flake8 and pylint fixes

* Try to 'import' ngraph-related packages on top of python files

This will help to specify type of function arguments, but can break unit tests if they're using functions directly without ngraph

* CI fixes

* Run tests from 'main_test.py' inside ngraph environment

* Fixed review comments

* Fixed comments
Added more tests for checking if inputs and outputs are same

* Renamed front_ng to moc_frontend

* Update package_BOM.txt
2021-06-24 12:21:15 +03:00
Vladimir Gavrilov
70f9d8564e Written reading the operation CTCGreedyDecoder for ONNX (as a custom operation). (#6215) 2021-06-18 09:54:41 +03:00
Roman Kazantsev
3292543252 Fix recovery of output subscript in Einsum implicit mode (#6131)
* Fix recovery of output subscript in Einsum implicit mode

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Fix code style

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2021-06-16 06:43:12 +03:00
Gleb Kazantaev
ea3ed8af21 Turn on IE and NG python APIs by default inside Model Optimizer (#5721)
* Turn on IE and NG python APIs by default inside Model Optimizer

* Remove fallback

* Fix mo_ut

* Remove MO wheel tests

* Add model_optimizer custom target to gather all MO deps inside single traget

* Fix PR comments
2021-06-16 03:12:24 +03:00
iliya mironov
421465adc1 Add ShapeOfConstFolding transform (#5858)
* Add ShapeOfConstFolding transform

* Add unit tests

* Update bom file

* Update transform file

* Hot fix

* Fix midle replaser

* Update unit tests

* Fix get value

* Refactoring Const Folding transformation. Move to back

* Update bom file

* Remove unuse code

* Add some unit tests

* Refactoring unit test

* Hot fix
2021-06-09 12:14:39 +03:00
Roman Kazantsev
2c3abf8f42 Use int64 for TopK indices output (#6085)
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2021-06-09 10:00:20 +03:00
Svetlana Dolinina
de2a163363 Error during Caffe model conversion with Python3.8 (#6056)
* added one more possible reason for Caffe error during caffemodel parser in code + add error description to FAQ
Also added MxNet error to FAQ based on Kate Generalova wording

* review fixes

* wording polishing

* wording polishing

* review fixes

* review fixes

* Update docs/MO_DG/prepare_model/Model_Optimizer_FAQ.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Update docs/MO_DG/prepare_model/Model_Optimizer_FAQ.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Update docs/MO_DG/prepare_model/Model_Optimizer_FAQ.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Update docs/MO_DG/prepare_model/Model_Optimizer_FAQ.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* review fixes

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>
2021-06-08 16:09:04 +03:00
iliya mironov
ae5608534e Add support resize with 2 inputs (#5927)
* Add support resize with 2 inputs

* Add unit tests

* Hot fix

* Change resize check from port count to connected num port conditions

* Fix conditions

* Refactoring code according to review

* Fix according to review

* Change onnresize11 input condition
2021-06-08 13:15:54 +03:00
Anastasia Popova
327c3149f6 Fixed feature dimension calculation in grouped_convolutions_fusing(). (#6054)
* Fixed feature dim calculation in concat_convolutions().

* Fixed feature dim calculation in concat_convolutions().

* Added comments, added unit test.
2021-06-08 09:53:39 +03:00
Yegor Kruglov
4d9fe14ec6 [MO] ConvolutionWithGroupResolver update to enable TF DepthwiseConv2dNative with in_channels=1 (#5528)
* changed permutation attribute in conv extractor

* changed conv get_group parameter

* implemented a transformation

* updated BOM

* specified transformation for in_channels 1

* added unittest and comment string

* updated convolution normalizer to convert depthwise convolution with group=1 to group convolution

* renamed function

* updated IR reader

* conversations resolving

* condition change
2021-06-07 20:22:26 +03:00
Yegor Kruglov
6a18b45337 [MO] Implementation of names uniqueness check (#5651)
* added new transformation to check the uniqueness of nodes names

* added unittest

* remove redundant line

* conversation resolving

* updated unittest

* added new unittest, added check for uniqueness of new node name

* added a description

* added renaming of several results with the same name and unittest for this case

* another implementation, updated unittests

* added a comment

* updated comments

* added comment to the nodes_with_equal_names func

* added a condition

* added a result name check in unittests
2021-06-07 16:44:16 +03:00
Ivan Tikhonov
c1608628d4 LowLatency v2 ngraph transformation (#5160)
* LowLatency 2.0: transformation and unit tests

* low latency 2.0: unit tests

* documentation and ngraph codestyle

* update CNN Interface of LowLatency transformation

* fix build on Windows

* fix build on Windows

* investigation of a failed build on Win OS

* ngraph codestyle

* fix build (werrors)

* New unit tests, refactoring

* update functional tests for Memory

* update LowLatency functional tests

* extend Memory tests to cover LowLatency v2 transformation

* clean up, code style

* fix unit tests

* update and fix unit tests, add feature to apply LLTv2 after LLTv1

* update docs, refactoring

* add several gna tests to skip config

* fix python api tests

* update python api, rename LowLatency_v2 to LowLatency2

* deprecate LowLatency v1

* Deprecate LowLatency v1 in IE

* fix wrong merge, codestyle

* resolve review comments

* fix python test

* update skip config

* apply online review notes, fix unit tests

* clean up, code style

* fix docs

* Use debug_messages instead of exceptions in llt v2

* fix unit tests

* Resolve review remarks
2021-06-07 15:13:41 +03:00
Ilya Naumov
149c43044c Set less strict numpy requirements (#6039) 2021-06-04 20:55:22 +03:00
Pavel Esir
d9d63d0d7e [MO] fix MarkNodesWithShapeValues (#5808)
* fix marking of nodes with shape values: corrected 'leaky' starting condition

* cleaned up code

* fixed t2t type collision error: removed strict assert from Pow; now type_infer is same as for other eltwise ops; added warnings about type alignment

* type cast for Pow according to ONNX spec

* fix highlight in dump_graph_for_graphviz

* soft_get('op')

* Revert "soft_get('op')"

This reverts commit cadfe18f

* Revert "type cast for Pow according to ONNX spec"

This reverts commit bf85ebf8

* applied review comments

* comment for ShapeOf bfs, removed Error from elementwise op

* reverted back dump_graph_for_graphviz: fill_color -> node_attrs

* applied last review comments: returned back Error, added type_infer into unit-test utils
2021-06-04 18:49:49 +03:00
Evgeny Lazarev
0db9d3e2c5 Added extractor for ONNX operation Size (#6031)
* Added extractor for ONNX operation Size

* Moved transformation of Size operation from TF specific to generic front phase

* Updated list of supported ONNX operation

* Moved unit test for Size decomposition to a new location
2021-06-04 17:18:01 +03:00
Eugeny Volosenkov
859a3b8a30 Deprecated warnings fix in MO (#6016)
* Add code style fixes

* Revert "Add code style fixes"

This reverts commit 490934f243.

* Fix Invalid escape sequence

* Fix Invalid escape sequence
2021-06-04 16:53:30 +03:00
Anastasia Popova
3825e90ae1 Fix of RollWithEmptyAxesReplacer transformation. (#5937)
* Fixed Roll output shape bug in RollWithEmptyAxesReplacer transformations.

* Added check in unit test.
2021-06-03 14:45:05 +03:00
Anton Chetverikov
f88222933a [MO] Add extractor for ONNX *OrEqual operations (#5932)
* Add extractor for ONNX GreaterOrEqual operation

* Add more extractors

* Fix extractor

Co-authored-by: achetver <anton.chetverikov@.intel.com>
2021-06-02 09:06:41 +03:00
Anastasia Popova
b1e7a5cdb1 Fixed duplicate names appearance in graph after fuse mul transformation. (#5842)
* Added manual set of unique name to the data node.

* Added attributes checks in unit test.

* Removed redundant line break.
2021-05-28 16:37:43 +03:00
Anton Chetverikov
9d3780648f Add missed attributes for Parameter layer (#5676)
* Add shape and element_type to ir_v10_attrs structure

* Add comment

* Update add_input_op_input_port_with_data() and add_input_op_output_port_with_data() functions with new GraphAPI

* Remove incorrectly added test

* Apply comments

* Update missed tests

* Add more checks to tests

Co-authored-by: achetver <anton.chetverikov@.intel.com>
2021-05-28 10:22:06 +03:00
Gleb Kazantaev
98ac1d04c3 Fix IE Python API search inside MO for Windows platform (#5862) 2021-05-28 09:57:16 +03:00
Anastasia Popova
a9230a916b LSTMCell tensor names fix (#5696)
* Added handling of debug information in create_node().

* Code refactoring.

* Checks fixed.

* Added comments, added unit test.

* Renamed unit test class.

* Fixed port number in unit test.
2021-05-27 15:13:44 +03:00
Evgenya Stepyreva
ffc9c95a2b Revert "Fuse mul transformation fix (#5518)" (#5831)
This reverts commit 84b94c9834.
2021-05-26 16:07:46 +03:00
Maxim Vafin
d8d9819b5f Fix security issue with XML parsing (#5686)
* Fix security issue with XML parsing

* Apply review feedback

* Rework defusing stdlib solution

* Apply review feedback
2021-05-26 14:17:55 +03:00
Gleb Kazantaev
7933e9f61d Find ie api based on platform (#5820)
Co-authored-by: Gleb Kazantaev <gleb@nncv666el.inn.intel.com>
2021-05-26 09:07:37 +02:00
Evgenya Stepyreva
74293c54df Transpose FQ optimization (#5763)
* Transpose FQ optimization

* Tests added
2021-05-25 16:42:21 +03:00
Evgeny Lazarev
43bdf6b3c1 Fix pad op with int input 2021.4 (#5772)
* Added operation ConvertLike to the MO

* Fixed transformations with Pad which insert Const with pad value of incorrect type

* Added constant folding to ConvertLike operation

* Fixed unit tests for Pad transformations to include ConverLike operations

* Update copyright year

* nGraph code style fix
2021-05-25 11:55:27 +03:00
Anastasia Popova
04de4e34bc Additional telemetry events in MO. (#5662)
* Added additional telemetry events.

* Separated sending tf1 and tf2.

* Small correction.

* Unit test fix.

* Added op_names_statistic field in graph. Added op names saving in loop ext, while ext.

* Optimize imports.

* Added debug print.

* Added comments, removed debug print.

* Added comment.

* Renamed dynamic shapes event label to partially defined, added unit tests.

* Added attribute checks, moved telemetry methods to separate file.

* Small corrections.

* Updated BOM file.
2021-05-24 15:21:29 +03:00
Vladimir Gavrilov
2bc69da1d1 Fix in model-optimizer/mo/back/ie_ir_ver_2/emitter.py. (#5742) 2021-05-21 18:58:03 +03:00
Yegor Kruglov
40c5d116e3 Updated condition in metadata depersonalize function (#5655)
* updated condition in metadata depersonalize function

* renamed list with keys

* removed unnecessary key
2021-05-21 18:08:57 +03:00
Svetlana Dolinina
8e956654bf fix stride for 1d maxpooling (#5710)
* fix stride for 1d maxpooling

* fix test
2021-05-21 11:57:40 +03:00
Roman Kazantsev
d98e954f5d Make order of port names determined in IR (#5701)
* Make order of port names determined in IR

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Make port names in determined order and adopted tests

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2021-05-20 13:44:06 +03:00
Anastasia Kazantaeva
e755232a7f fix date (#5694) 2021-05-19 22:21:51 +03:00
Anton Chetverikov
538f407829 Fix errors for VariadicSplit layer restored from serialized IR (#5613)
* Fix errors in VariadicSplit layer restored from serialized IR

* Update VariadicSplit specification and error message to allow 1D tensors on 1st input

* Update spec

* Resolve comments

* Apply comments, add unit tests

* Update unit tests
2021-05-19 19:03:58 +03:00
Evgeny Lazarev
369b427657 Fixed MO CMakeList to remove unit_tests directory (#5670) 2021-05-18 20:37:54 +03:00
Gleb Kazantaev
8be740a5aa Enable Pruning transformation by default inside Model Optimizer (#5633) 2021-05-18 12:48:01 +03:00
iliya mironov
642a62d0e2 Add axis support (#5242)
* Add axis support

* Update dequant extractor

* Update qdeq ops

* Refactoring quantize

* Update dequantize resolver

* Update dequantize op

* Refactoring dequantize

* Some fixes for quantize and dequantize

* Update unit tests

* Reafctoring quantize/dequantize axis support

* Move quantize/dequantize resolvers to middle

* hot fix

* Fix unit tests

* Fix unit tests

* Update quintize resolver comment

* Refactoring code according to code review

* Fix according to review

* Change order for transforms quantize pipline
2021-05-17 15:03:22 +03:00
Evgeny Lazarev
717499cf2f Common telemetry (#5032)
* Moved telemetry to repo root directory from MO

* New telemetry package in the "openvino" sub-directory

* Removed telemetry from the MO BOM

* Updated MO BOM and added stub file for telemetry

* Fixed license header

* Fixed license headers and cleaned up the telemetry setup.py

* Fixed import

* Added temporary dependency for openvino-telemetry

* Added ignore for pylint issues

* Fixed import statements

* Updated imports in the telemetry library

* Removed telemetry library. Added link to another private repo

* Removed redundant start_session event for the MO

* Changed approach to import the telemetry library

* Minor code refactoring

* Updated MO telemetry events sending messages

* Refactor sending events for the IE runtime check

* Disable forcing warnings for deprecated methods

* Removed changes from the requirements.txt to install telemetry library to avoid merge conflicts

* Update copyright in the model-optimizer/mo/utils/telemetry_stub.py

Co-authored-by: Gleb Kazantaev <gleb.nnstu@gmail.com>

Co-authored-by: Gleb Kazantaev <gleb.nnstu@gmail.com>
2021-05-14 21:56:03 +03:00
Ilya Naumov
3e076a88aa Align MO pip requirements (#5171)
* Align MO pip requirements

* fix missing mxnet on platforms other than Windows or Linux

* remove spaces near environment markers
2021-05-14 16:05:25 +03:00
Sergey Lyubimtsev
5af767a0a2 Add MO extras requires for supported DL frameworks (#5615)
* Add extras requires for supported DL frameworks

* fix pylint issues

* codestyle (PEP8)

* Indentation
2021-05-13 20:20:41 +03:00
Anton Chetverikov
f2f44ce160 Add uint64 to data types maps (#5603) 2021-05-12 18:50:38 +03:00
Gleb Kazantaev
b4565b7b4f Add Model Optimizer --transform option (#5504)
* Execute MO stages inside subprocess to have single IE check

* Add --transform key

* Updated ofline transformations to execute user specified passes; updated logic to raise when --transform is used

* Parametrize LowLatency transformation with num_iterations key

* Fixed MO and IE versions comparision

* Use subprocess for offline transformations execution to catch errors

* remove ie_is_available from IR; fixed typo

* Fix for old IE versions

* Update parse_transform key unit tests

* Show available transformations

* Fixed typo

* Fix review comments

* Fix python2 compatibility

* Fixed review comments

* Fixed __main__ import
2021-05-12 18:42:56 +03:00
iliya mironov
fe5ca28b6e Smal fix with tf env_setup (#5476)
* Smal fix with tf env_setup

* Fix tf loader

* Fix version checker
2021-05-12 15:33:03 +03:00
Pavel Esir
0b22d6c51c Add Gather-7 to MO (#5264)
* initial solution

* added unit-tests + some corrections

* axis getting improvements

* fixed MO IR reader for old IR's

* a couple of corrections

* applied review comments

* corrected negative batch_dims normalization for shape calculation, for IR original negative values are kept

* added additional checks and negative tests
2021-05-11 22:29:59 +03:00