Commit Graph

410 Commits

Author SHA1 Message Date
iliya mironov eadeae6c47
Fix ChangeOutputTypeAttributes BackReplacementPattern (#6949)
* Hot fix

* Add unit test
2021-08-09 19:22:21 +03:00
Vladimir Gavrilov 838e701e5e
ExpandRangeConstant adjustment for bidirectional Broadcast (#6739)
* Fixes in the transformation ExpandRangeConstant.

* Fixed test.

* Now we use use ShapeOf for both inputs of Broadcast.

* Now the transformation ExpandRangeConstant uses two Gather layers.

* Deletec commented code.

* Fixed tests for the transformation ExpandRangeConstant.

* Rewritten the transformation ExpandRangeConstant using Select.
2021-08-09 16:49:07 +03:00
Mateusz Bencer e4dfff387b
Apply moc transformations on FE API path (#6871)
* apply moc transformations

* changed type of net in apply_moc_transformations

* review remarks

* args->argv typo
2021-08-05 18:08:40 +03:00
Pavel Esir bfca47ad5e
[MO] Range output_type correction for FP16 (#6590)
* added ChangeRangeOutputType.py

* applied review comments

* corrected error message - warn user to use FP32

* renamed ChangeCastOutputType.py et ell.

* merged ChangeRangeOutputType.py, ChangeCastOutputType.py into a singe file

* corrections

* typo fix

* applied comments: faster find_and_replace loop, wording correction
2021-08-02 11:41:12 +03:00
Evgeny Lazarev d28ecc4f2f
New approach for Proposal sub-graph conversion for TF OD API models (#5847)
* Draft version of new approach for Proposal sub-graph conversion for TF OD API models

* Added clip_after_nms = True for Proposal sub-graph being replaced with DetectionOutput

* Refactored code to insert DetectionOutput instead of Proposal operation

* Code cleanup

* Added separate function to insert DetectionOutput instead of Proposal operation

* Updated transformation configuration files for the TF OD API models with Proposal transformation

* Code refactoring

* Code refactoring

* Fix for the condition

* Fixed transformation

* Fixed transformation. One more time

* Updated document about conversion of the TF OD API models

* Update code comments
2021-08-01 10:17:22 +03:00
Roman Kazantsev 032cebb9da
Implement transformation for TensorFlow 2 Map Function (aka tf.map_fn) (#6836)
* Implement transformation for TensorFlow 2 Map Function primitive

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

* Add a description for get_external_node_by_internal_id function

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

* Correct a name for get_external_nodes_by_internal_id function

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

* Fix a description for get_external_nodes_by_internal_id function

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

* Add logging and fix indentation

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

* Use skip_nodes_by_condition to by-pass StopGradient nodes for tf.map_fn

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2021-07-30 12:10:59 +03:00
Ivan Tikhonov 6673a90659
MO DeformableConv: fix a set of attributes (#6806)
* MO DeformableConv: fix a set of attributes

* codestyle

* resolve review comments

* resolve review comments
2021-07-29 13:49:12 +03:00
Mikhail Nosov 868fad33ab
[MO] Add support to moc_frontend of ":" as delimiter for --input and --output (#6543)
* [MO] Add support to moc_frontend of ":" as delimiter for --input

Additions:
Changed default logic for 'Place::get_in(out)put_port' to return nullptr
Changed default logic for 'InputModel::get_place_by_tensor(operation)_name' to return nullptr

* Corrected comments in code

* Missing empty line

* Clang format fixes

* Fix review comments

* Updated test to verify review comments fixes

* Update unit tests after rebase

* Apply review comments
2021-07-29 13:09:51 +03:00
Mikhail Nosov a95d59014c
Rename "pdpd" frontend to "paddle" (#6842)
* Rename "pdpd" frontend to "paddle"
Also renamed mo_pdpd.py+main_pdpd.py to mo_paddle.py+main_paddle.py

Class names were not renamed

* Update package_BOM.txt
2021-07-29 11:43:07 +03:00
iliya mironov 16d0c28314
Add check if fastjsonschema installed (#6775) 2021-07-26 11:39:44 +03:00
Mikhail Nosov 25fc647b2f
Azure CI: run MO unit tests after OpenVINO build (#6772) 2021-07-23 17:42:49 +03:00
Roman Kazantsev 12fb83dc1e
Correct layout for Einsum inputs and output (#6696)
* 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>

* Correct layout adjustment for Einsum inputs and output

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

* Correct a comment in the unit-test

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

* Setup correct transformation dependencies for LayoutChangeForEinsum

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2021-07-23 11:01:06 +03:00
iliya mironov e1bffcc36c
Add json validate (#6449)
* Add json validate

* Fix json schema

* Fix schema loader

* Add unit test

* Update bom file

* Update all requarments

* Update dev requarments

* Update requrments

* Update path to schema

* Update schema

* Add some unit tests

* Move schema to root dir

* Update schema path in bom file

* Fix unit test

* Fix bom

* Change path to schema

* update setup

* Fix setup

* Fix mo args test

* Refactoring some code

* Refactoring according to review

* Update sort imports

* Remove id attribute from schema

* Refactoring validator

* Fix according to review

* Move schema from json to dict. Update unit tests.

* Fix BOM file

* Update bom file
2021-07-22 21:12:44 +03:00
Vladimir Gavrilov abc6a336b1
Fixed processing tags in summarize_graph.py (#6726) 2021-07-22 14:39:54 +03:00
Mikhail Nosov aecb2b9693
Static library for ngraph::frontend_manager (#6719)
* Static library for ngraph::frontend_manager

* Static + Shared versions

* Fix CI

* USE_STATIC_FRONTEND_MANAGER macro

* Set USE_STATIC_FRONTEND_MANAGER compile definition as public

* Revert back incorrectly removed line

* Apply more review comments
2021-07-22 02:42:34 +03:00
Evgenya Stepyreva a3825ba1a5
Zero point optimization (#6683)
* Zero point optimization

* Expand the equality to zero criteria
2021-07-21 15:59:59 +00:00
iliya mironov 253ff51e69
Remove split-concat subgraph before pad op (#6506)
* Remove split-concat subgraph before pad op

* Fix unit tests

* Add unit tests for PadNormalizer

* Fix according to review

* add propagation up for Pad

* Fix value propogation

* Remove PadMormolizer

* Refactoring according to review
2021-07-21 14:33:43 +03:00
Mikhail Nosov fbd0d8beba
MO: ensure ngraph.frontend is installed (#6698)
MO: when finding IE/nGraph - add search path to beginning of PYTHONPATH, LD_LIBRARY_PATH
2021-07-21 14:18:51 +03:00
Ilya Lavrenov b62d93efff
Enabled code style check for tests (#6724) 2021-07-20 18:59:38 +03:00
Maxim Vafin 960ba48e6f
Rework model loading in FE manager, implement PDPD probing (#6358)
* Rework model loading in FE manager, implement PDPD probing

* Fix build

* Fix build

* Fix build

* Fix unicode

* Fix merge issues

* Fix codestyle

* Read frontends path from frontend_manager library location

* Fix codestyle

* Fix FE dependency

* Fix dependencies

* Fix codestyle

* Check if model file exists

* Revert adding model to lfs

* Add test model

* Fix cmake dependencies

* Apply review feedback

* Revert pugixml

* make getFrontendLibraryPath not public API

* Fix codestyle

* Apply fix from Ilya Lavrenov

* Add FE dependency in legacy tests

* Remove not needed dependency

* Better support Unicode

* Fix build

* Fix build

* Fix build

* Add dependency foe deprecated tests

* Fix dependency

* Fix typo

* Revert adding FE dependency to IESharedTests

* Remove relative paths from frontend unit tests

* Apply review feedback

* Fix typo

* Return allow-undefined, since kmb dependecies fail to link

* Fix merge conflict

* Compare functions in reader tests

* Simplify code to load from variants

* Remove supported_by_arguments from public api

* Fix codestyle

* Fix build

* Compare names in reader tests

* Fix wchar in variant

Co-authored-by: Ilya Churaev <ilya.churaev@intel.com>
2021-07-19 20:10:00 +03:00
Ilya Lavrenov bc36425381
Added suggest-override flag (#6631) 2021-07-16 18:55:05 +03:00
Evgenya Stepyreva 46a20fdb12
Zero point optimization (#6617)
Ticket: #59063
Summary: try to fuse zero point to the weights in order to make the zero point == 0.
2021-07-13 15:37:15 +03:00
Ivan Tikhonov 434fcec53c
DeformableConvolution v8: MO and IR reader (#6532)
* ModulatedDeformableConvolution extractor

* Update MO to generate DeformableConv opset8

* clean up

* ir reader tests

* fix bilinear_interpolation_pad attribute

* update BOM file

* fix BOM file

* delete unnecessary tests

* resolve review comments

* fix e2e test

* fix e2e test

* resolve review comments

* add comment
2021-07-12 08:09:41 +03:00
Gleb Kazantaev 2a970a56d3
Enable common optimizations on MO (#6245)
* Enable common optimizations on MO

* Added tensor name tracking; updated tests

* Disable DilatedConvolution transform

* Fix TopK3 transformation

* Codestyle fix

* Update tensor name logic

* Fix scatter nd shape inference for dynamic shape

* Update FrameworkNode to propagate dynamic output shape

* Enable HSwish in MO that is missing in nGrpah

* Cleanup MO and IE code

* Fix review comments

* Fix unit test
2021-07-09 00:38:07 +03:00
Dmitry Pigasin 8b52a4c0c5
Remove sudo from mo install_prerequisites.sh (#6378)
* Remove sudo from mo install_prerequisites.sh

* Move venv folder to $HOME dir

* Wrap $venv_python_binary with double quotes

* Add variable to store `$HOME/venv_mo`

* Use one venv for all OpenVINO tools

* Add ROOT_DIR variable

* Add python venv creation

* Add message about venv to the .bat script

* Fix a typo
2021-07-08 17:10:00 +03:00
Yegor Kruglov b56164e804
[MO] Updating condition in TF Const value extracting (#6322)
* update value extracting condition

* added a comment

* updated unittest

* added a scalar test, little fix for scalar values extracting
2021-07-08 15:55:29 +05:00
Ilya Lavrenov 652c6f6247
Extract OpenVINO version from header, if CI one is not defined (#6555) 2021-07-08 13:01:54 +03:00
Ilya Lavrenov 35d9bd0f63
Removed NGRAPH_PYTHON_BUILD_ENABLE (#6556) 2021-07-07 21:23:36 +03:00
Anton Chetverikov 8a31e8aafb
Provide `keep_output_port` attribute to `add_opoutput` function (#6117)
* Implement way to provide keep_output_port attribute to add_opoutput function

* Update tests

* Update comment

* Fake commit to pictures merge problem

* Change default value

* Add type

* Revert "Fake commit to pictures merge problem"

This reverts commit 41850765e0.
2021-07-05 12:34:44 +05:00
Alexey Suhov 64cbdb9c22
[MO] exclude MO build artifacts and add unit_tests to cpack (#6507) 2021-07-03 16:50:26 +03:00
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