Commit Graph

320 Commits

Author SHA1 Message Date
Svetlana Dolinina
7b52e3155a Tdnnf (#5255)
* initial changes (IR not generated)

* extractor fix

* convert tdnnf (with correct infer)

* refactoring + comments in code

* added unit tests + couple fixes based on tests

* change order for old convolutions

* fix pylint

* small refactoring

* added if to remove changes in old irs

* doc updated

* fix layout and kernel shapes for old convolutions

* fixed test

* moved test

* fix import in test

* fixed backward compatibility

* review fixes
2021-04-29 14:38:08 +03:00
Anastasia Popova
07214d0a47 Changed "out_port_id" attribute setting in mapping file to store tensor names. (#5344)
* Removed port id from fw_tensor_debug_info attribute.

* Added port number to tensor names in kaldi, mxnet. Fixed Const naming.

* Sort imports.
2021-04-29 14:05:35 +03:00
Svetlana Dolinina
4daa74303a changed output finding + add error to catch problem in future (#5368)
* changed output finding + add error to catch problem in future

* added unit test

* review fixes

* review fixes

* fix typo
2021-04-28 12:59:59 +03:00
Anton Chetverikov
8395ce1b0f Update modules version checker in MO to support ~= (#5342)
* Add check for ~= sign for modules versions check

* Add unit test

* Update check for environment markers

* Update check for ~= sign

* Update unit tests

Co-authored-by: achetver <anton.chetverikov@.intel.com>
2021-04-28 11:23:08 +03:00
Sergey Lyubimtsev
7d5fd3d51c MO Transformation configs are missing in openvino-dev package (#5302)
* MO Transformation configs are missing in openvino-dev package

* fix pylint issues

* add escape

Co-authored-by: Roman Donchenko <roman.donchenko@intel.com>

* add escape

Co-authored-by: Roman Donchenko <roman.donchenko@intel.com>

* add mo_caffe.proto

* Add MO package_data to openvino-dev package

Co-authored-by: Roman Donchenko <roman.donchenko@intel.com>
2021-04-28 10:15:22 +03:00
Svetlana Dolinina
3028c78594 fix typo + test (#5392) 2021-04-27 13:37:02 +03:00
Anton Chetverikov
576e692b1d Update errors raising cases in modules versions checker in MO (#5141)
* Change error raising to message printing

* Update modules versions check

* Update check and add unit test

* Fix wrong function call

* Update unit tests

* Fix test

Co-authored-by: achetver <anton.chetverikov@.intel.com>
2021-04-23 13:23:06 +03:00
Yegor Kruglov
d2c4d068b5 fixed mismatch of input names between framework and MO .mapping file (#5256) 2021-04-21 18:46:49 +03:00
Evgeny Lazarev
f3d1aa6490 Moved MO unit test files to a separate directory (#5312)
* Removed test-generator from all MO requirement files except the dev one

* Moved all MO unit tests files to a separate directory

* Added __init__.py files to the tests directory. Fixed importing paths for some unit tests

* Fixed imports in all unit tests. Moved all unit test related files from the MO code to the dedicated directory

* Renamed directory with unit test utils

* Updated imports in unit tests
2021-04-20 14:47:18 +03:00
Yufei Wu
9488bb0b00 %~dp0 can't handle path which include Space (#5274)
* %~dp0 can't handle path which include Space

The default OpenVINO install directory is C:\\Program file(86)\\Intel\\..., which contains space. So when users run this script, the path is wrong.
To handle this issue, I modify two part:
one is the python_command, use a local var to store this path. 
The other is the errorlevel, just add double quotation marks

* fix python_command path issue

* delete unused blank line
2021-04-19 18:35:32 +03:00
Anastasia Popova
cb62f3f579 Added operation Roll to MO (#5206)
* Added operation Roll to MO.

* Updated BOM file.

* Replaced FrontReplacementPattern with FrontReplacementOp.

* Added set_input_permutation() to Roll infer function.

* Optimize imports.

* Code refactoring.

* Code refactoring.

* Removed unnecessary variable.

* Added name to the second reshape.

* Added rename_nodes to set original op name be at second reshape.

* Small fix.
2021-04-16 13:37:27 +03:00
Sergey Lyubimtsev
8013d2f7ba MO cannot convert Caffe model from PyPI "openvino-dev" distribution (#5239)
* MO cannot convert Caffe model from PyPI "openvino-dev" distribution

* use os.pardir instead of '..'

* remove mo subdir
2021-04-16 13:35:25 +03:00
iliya mironov
efeff1ee3e Add keep split output ports without consumers (#5136)
* Add keep split output ports without consumers

* Fix ir reader for split outputs

* Update unit tests

* Refactoring code according to review

* Fix unit test

* Fix
2021-04-12 17:49:53 +03:00
Anastasia Popova
cadff031d5 Fixed framework name attribute in mapping file. (#5046)
* Fixed framework name attribute for onnx, mxnet.

* Fixed framework name attribute for caffe.

* Removed unnecessary attribute setting from add_opoutput()

* Added identity nodes adding to outputs in mxnet loader.

* Removed unnecessary reformat.

* Removed unnecessary reformat.

* Added check for empty name.

* Used nodes indices instead of node names in loader.

* Code refactoring, small bug fixed.
2021-04-08 20:59:44 +03:00
Yegor Kruglov
ca889f530d [ MO ] Warnings fix (#5105)
* warnings fix

* remove redundant backslash

* add whitespace in the error message
2021-04-08 14:09:00 +03:00
Svetlana Dolinina
f858a62836 fix bug: assert is keyword, not function (#5131)
* fix bug: assert is keyword, not function

* fix comment
2021-04-08 12:02:18 +03:00
Sergey Lyubimtsev
f438a3a321 Add entry point for model optimizer as 'mo' alias (#5052)
* Add entry point for model optimizer as 'mo' alias

* Add entry point for mo package
2021-04-06 10:41:44 +03:00
Evgeny Lazarev
1d26a5600c Fixed extracting TF models with string constants (#5110)
* Fixed extracting TF models with string constants

* Fixed parsing strings from the TF models
2021-04-06 10:33:40 +03:00
Alexey Suhov
6a16b70e0e setupvars and demos: Fix getting script dir on macOS 10.15 with with default zsh shell (#5094) 2021-04-02 21:37:21 +03:00
Yegor Kruglov
c966aea879 Update StridedSlice extender to handle StridedSlice op with empty attributes (#4980)
* update ss extender

* change the condition

* add an assert

* fix for IR comparator tests failures
2021-04-02 09:40:46 +03:00
Evgenya Stepyreva
8d2f58caad numpy.packbits usage for numpy 1.14.0 support (#5078) 2021-04-01 20:11:12 +03:00
Dmitry Kurtaev
5272bd4ba9 Test MO wheel content (#5054) 2021-04-01 18:03:28 +03:00
Maxim Vafin
2bed9c9277 Fix ScatterND validation and implement evaluate (#4905)
* Fix ScatterND validation and implement evaluate

* Apply review feedback

* Update scatternd.py
2021-03-31 19:01:46 +03:00
Svetlana Dolinina
ffa467a5ad fix batch adding to init value of read value (#4187)
* fix batch adding to init value of read value

* fix for batch in Kaldi models

* added broadcast to be able reshape in IE

* test fixes, added batch broadcasting to created constants

* pep fixes

* move all changes to 1 transformation

* added unit test and fix insertSelect transformation

* added comments

* remove unneeded params search

* fix element_size to send correct batch

* fix update batch in element_size

* couple fixes

* update BOM file

* fix review comments

* review fixes

* review fixes

* fix license headers
2021-03-31 11:32:36 +03:00
Pavel Esir
6477e8ec01 [MO] Fix fp16 in shapeof subgraphs (#4524)
* Initial working solution

* moved bfs_search_apply_on_shapeof_subgraph_nodes from utils/graph.py to MarkShapeOfSubgraphDataType.py

* Reused bfs from MarkSubgraphsWithCorrectLayout.py

* fixed e2e precomit issues: specified correct const data_types, fixed BFS search staring point to avoid nodeless shapeof subgraphs

* fixed mxnet_rnnt: added converting all Const nodes in ShapeOf subgraph in MarkAndChangeDataTypeInShapeOfSubgraphs.py, revised Const values in transformations that affect ShapeOf subgraph nodes

* reverter ReverseV2ToReverseSequence.py and DecomposeBidirectionalRNNSequence.py

* in MarkSubgraphsWithCorrectLayout BFS search beauty applied

* apply review comments, returned back 'in_shape_subgraph' attribute

* graph condition added

* MO IR reader fix for mixed FP16 models, added replacer order placement comment

* moved to back phase

* new solution with marking nodes from bottom to top (WIP)

* successfully tested on back phase

* corrected unittest

* removed check for start nodes size in bfs

* fix transformations that insert f64 to f32 in shape subgraph

* corrected log.warning -> log.debug

* revised list if shape input operations added unittest for Const shape inputs

* applied @lazarevevgeny's comments

* licence head corrections
2021-03-30 23:16:32 +03:00
Alexey Suhov
e072c96237 fix test_missed_intel_header fail in mo\__main__.py (#5047) 2021-03-30 22:46:14 +03:00
Dmitry Kurtaev
47cf3bdc35 Use MO as module (#4801)
* Use MO as module

* Add legal notice
2021-03-30 18:11:58 +03:00
Dmitry Kurtaev
41f0eb51c5 Enable mo.front.common.extractors module (#5018)
* Enable mo.front.common.extractors module

* Update package_BOM.txt
2021-03-30 13:56:49 +03:00
Dmitry Kurtaev
a2a7320d74 [MO] Fix EfficientDet conversion (#5029) 2021-03-30 12:28:18 +03:00
Mikhail Ryzhov
d314a7c350 Added version.txt to MO wheel (#4982) 2021-03-30 10:46:35 +03:00
Alexey Suhov
a2bf62f488 Align copyright notice in sh, bat, cl, cc, pyx source files (#4995) 2021-03-27 01:26:27 +03:00
Alexey Suhov
6478f1742a Align copyright notice in python scripts (CVS-51320) (#4974)
* Align copyright notice in python scripts (CVS-51320)
2021-03-26 17:54:28 +03:00
Maxim Vafin
851e203f72 Speed up determined_sort which speeds up emitting the IR (#4928) 2021-03-26 12:50:57 +03:00
Roman Kazantsev
61102d63cc Support DIEN CTR model by the MO tool (#4808)
* [MO] Split iteration node for TensorIterator in case multiple consumers

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

* Implement additional BackEdgeTensorIterator and NonConstBeginStridedSlice transformations

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

* Finalize implementation of DIEN support by the MO tool

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

* Add unit test for NonConstBeginStridedSliceReplacement transformation

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

* Fix retrieving shrink_axis_mask attribute value

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

* Address the majority of review feedback

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2021-03-26 11:52:36 +03:00
Evgenya Stepyreva
2e75aafbe2 INT4 compression (#4912)
* INT4 compression

* packing tests

* (U)INT4 IR Reader enabling

* Cast test header added

* Fix graph.clean_up

* Review discussions addressed: comments clarification, variable naming, fuller test coverage
2021-03-26 01:06:44 +03:00
Evgeny Lazarev
522ad39a48 Tf 2.0 od api models with loop (#4772)
* Do not run transformations for TF 2.X OD API models recursively (needed for models with Loop operation)

* Added anchor front transformation to group all TF OD API transformations. Added new necessary dependencies from KerasRNN transformations related to While support

* Added JSON configuration files for TF 2.4 OD API SSD and EfficientDet models

* Updated documentation with table of supported TF 2.x OD API models

* Improved visualization of the dependency graph

* Updated version of the pre-processing transformation for TF 2.4 OD API models

* Fixes in the TF 2.x OD API models conversion

* Fixed order of applying mean/scale values for TF 2.X OD API pre-processing

* Updates to the documentation

* Fixes for the preprocessor block transformation for the TF OD API models

* Added code comments

* Fixed bom file

* Unit tests for the TF 2.4 OD API ObjectDetectionAPIPreprocessor2Replacement transformation

* Code cleanup

* Updates to the documentation on how to convert TF OD API models and graph dumper

* Added assert to make sure that operations in the `get_specific_ops_with_const_inputs` has exactly 2 inputs
2021-03-25 17:56:35 +03:00
Maxim Vafin
2a52747b03 Fix reading FP16 scalars from TensorFlow (#4935) 2021-03-25 15:59:02 +03:00
Maxim Vafin
d40a607ca0 Support Pad-2 in opset-11 ONNX model (#4886)
* Support Pad-2 in opset-11 ONNX model

* Add unit test for pad

* Apply review feedback
2021-03-25 12:05:28 +03:00
Evgeny Lazarev
062bfd88d3 Fix Gelu parameter name (#4895)
* Rename attribute of the "Gelu" operation from "approximation" to "approximation_mode"

* Updated MO file for coverage check
2021-03-22 19:35:32 +03:00
Yegor Kruglov
244af264e6 Add remove_value_output attribute to onnx ArgMax extractor (#4831)
* add remove_value_output to onnx argmax extractor

* update TopK extender

* update copyright

* change condition in topk extender based on connection logic
2021-03-22 14:19:27 +03:00
Evgeny Lazarev
64e96fbd9a Fixed dead lock in the telemetry sender (#4883) 2021-03-19 15:12:27 +03:00
iliya mironov
5bb8571980 Add ScatterElements value propagation (#4724)
* Add ScatterElements value propogation

* Add condition for input nodes

* Add asserts

* Refactoring scatter according to review

* Add unit tests for 1d axis tensor

* Refactoring according to review

* refactoring unit test

* Refactoring according to review

* Update unit test

* Update unit test
2021-03-18 16:55:35 +03:00
Ilya Lavrenov
25c2fea2f9 Build python wheel w/o strict dependency to _pyngraph (#4837)
* Build python wheel w/o strict dependency to _pyngraph

* Exclude extra components which are not needed for IE python wheel

- myriad_compile
- myriad_perfcheck
- compile_tool
- inference_engine_c
2021-03-18 11:00:14 +03:00
Vladimir Gavrilov
24c31fba6a Fixed bug in the MO transformation UnsqueezeTileReshapeBlockToInterpolate (#4710)
* Some additional checks in the MO transformation UnsqueezeTileReshapeBlockToInterpolate.

* Refactored transformation UnsqueezeTileReshapeBlockToInterpolate: checks of applicabilty were moved into the separate function.

* Rewritten the MO transformation UnsqueezeTileReshapeBlockToInterpolate.

* Now we replace all block Unsqueeze+Tile+Reshape by Interpolate-4.

* Fixed comment.

* Added comments about applicability criteria.

* Some fixes.

* Small fix.

* Deleted redundant type casts.

* Added an example into comment.

* Now an interpolated axis length is calculated using the function node_to_get_shape_value_of_indices.

* Fixed tests.

* Optimized imports.
2021-03-17 21:56:25 +03:00
Evgenya Stepyreva
f3abba3685 [ MO ] Put FQ fuses under the disable_fusing key (#4829) 2021-03-17 08:51:40 +03:00
Anastasia Popova
7111aff4a9 Fix of tensor names propagation in loops and in add_opoutput(). (#4565)
* Added tensor names propagation in loops and add_opoutput.

* Removed wrong changes.

* Fixed result rename test.

* Stage names fixed.

* Added tensor names propagation to outputs for caffe, tensorflow.

* Added tensor names propagation to outputs for kaldi.

* Fixed bugs.

* Bug fixed.

* Added fake outputs removal.

* Fixed bug.

* Added removal attr to fake outputs in kaldi, caffe.

* Fixed bug.

* Port indices fixed.

* Fixed fake outputs removal.

* Added get_attribute_between_nodes, set_attribute_between_nodes methods, fixed fake output removal.

* More comments added.

* Removed unnecessary stage sets in tests.

* Removed unnecessary output check.

* Revert wrong change.

* New line at the end of file.

* Output cut test.

* Output cut test added.

* Output cut test.

* Added unit tests, comments. Code refactoring.

* Removed unnecessary soft_get.

* Fixed bug in output_cut, code refactoring.

* Code refactoring.

* Added comments.

* Fixed bug in while loop.

* Corrected comments, code refactoring.

* Comments edited, code refactoring.

* Code refactoring.
2021-03-16 16:00:56 +03:00
Evgeny Lazarev
56a179c6a3 Added support for attribute 'pad_to_max_dimension' for TF OD API models (#4720)
* Added support for attribute 'pad_to_max_dimension' for TF OD API models

* Restored line removed by mistake
2021-03-11 13:21:20 +03:00
Mikhail Ryzhov
98dbab27a4 Added mo.py to wheel packages (#4723) 2021-03-11 11:10:45 +03:00
John Gibson
3330ef3da3 Change is to == to avoid warning (#4683) 2021-03-10 10:03:55 +03:00
Evgeny Lazarev
99f94ca09c Adding v7::Gelu operation (#4497)
* Added support for Gelu-6 to the MO

* Adding Gelu-6 to ngraph and python API + some tests

* Fixed typo in the Gelu approximation mode

* Fixed Gelu-6 reference implementation for Tanh mode

* Added transformation to downgrade v6::Gelu to v2::Gelu

* Added specification for the Gelu-6

* Code style fixes

* The Gelu-6 operation specification update

* Fixed compilation issue in reference implementation for Gelu

* Fix compilation issues for some OSs

* Code style fix

* One more cpplint issue fix

* Fixed Gelu6 reference implementation compilation on Windows.

* Code style fix

* Fixed various ngraph unit tests

* Code style check

* Reverted Gelu-2 to be fused op

* Fixed Gelu6 downgrade transformation

* Added unit test for Gelu6Downgrade transformation

* Update copyright year

* Updated copyright year

* Replaced tab characters with 4 spaces in IR reader tests

* Code style fixes

* Added default value for GeluApproximation mode for Gelu-6 op

* Fixed code style for Gelu-6

* Changed order of parameters for the Gelu evaluate to potentially avoid backward compatibility issues with ARM plugin

* Fixed code style

* Introduced opset7. Moved Gelu6 to opset7

* Fixed non-updated transformation

* Fixed opset version in ngraph Python API for Gelu operation

* Fixed typo in the opset number in the documentation

* Reverted some changes related to Gelu6

* Updated MO to produce Gelu7

* Updated unit tests for Gelu

* Updated Gelu7 specification

* Changed gelu reference implementation. Added opset7 to Python packages

* Updated Python API tests for Gelu operation

* Code style fix

* Marked get_approximation_mode function as const

* Added missing "const" qualifier

* Fixed code style issues in tests

* Added extractor for MxNet operation Gelu

* Spelling issues fix

* Updated MxNet supported symbols

* Added NGRAPH_OP_SCOPE for Gelu7 validate_and_infer_types

* Fixed a typo in the comment
2021-03-09 22:45:45 +03:00