Commit Graph

417 Commits

Author SHA1 Message Date
Pavel Esir
f77d838e6c [MO] turn on MarkSubGraphsWithCorrectLayout for TF NCHW (#7150)
* turned on MarkingSubgraphsWithCorrectLayout for TF NCHW

* restricted MarkSubgraphsWithCorrectLayout.py only to TF

* added comments why need to MarkSubgraphsWithCorrectLayout even for TF NCHW models
2021-08-20 18:47:45 +03:00
Ilya Churaev
334bf9d227 Moved DiscreteTypeInfo to ov namespace (#7127)
* Moved DiscreteTypeInfo to new opset

* Revert old header

* Fixed code style
2021-08-20 06:42:15 +03:00
Eugeny Volosenkov
38022c4cd6 Mo implementation for If with tf extractor (#6662)
* Add tf2.x impl for If

* Fix ir_engine

* Fix opset

* Fix BOM file

* Added new test

* Fix comments

* Add subgraph_utils

* Fix comments

* Fix transform

* code refactoring

* Fix description

* rewrite support for empty tensor in if

* added onnx extractor

* delete onnx_if

* fix bug with fake_outputs

* Fix test

* Fix control_flow and fix commentaries

* create method results_mapping_and_finding_fake_outputs(output_nodes_in_subgraph,
2021-08-19 10:13:21 +03:00
Anton Chetverikov
6369f43c99 Support unregistered operations in MO IR Reader (#6837)
* Add support for unregistred operations in MO IR Reader

* Remove commented lines

* Add shapes equality check

* Update comments

* Update groupconv_to_conv function to support case with multiple destinations

* Add ir_data_attrs attribute to restored layers

* Update copy_shape_infer function to new graph api

* Add attribute IE to unsuppurted operations to save their attributes

* Fix wrong attribute name

* Update commentary

* Partially revert updating to new Graph API to fix regression, add appropriate comments

* Update code comments

* Rename copy_shape_infer function and add more comments
2021-08-18 12:56:13 +03:00
Kate Generalova
56bb84f0b2 fix mo module version check (#7041)
* fix mo module version check

* add one more version check
2021-08-16 21:22:40 +03:00
Pavel Esir
4738bbd757 [MO][nG] add Gather-8 to MO, layer tests, nG python api unit-tests and up/down-grading transformations (#6560)
* gather-8 upgrade/downgrade transforms

* bump to opset8

* add Gather-8 to MO

* fix permutation for Gather

* added TF layer tests, ONNX layer tests for negative indices, and nG python api unit-tests for negative indices

* typo fix, disable downgrading transformation

* disable downgrade in clDNN, line width style fix

* all Gathers are converted to 7th version, transformations will be enabled/disabled while op will be added into plugins

* disabled Gather8LayerTest on GPU

* added common function for Op replacement

* concretized meaning of negative indices, fixed some typos

* applied review comments: left only meaningful layer tests

* removed op replacing functions from common utils

* returned back transformations without subroutines

* corrected style, added comments to common_optimizations.cpp
2021-08-13 11:56:49 +03:00
Mikhail Nosov
c4bd0a45d3 MO: Support of discovering of suitable MOC frontend (#6888)
* MO: Support of discovering of suitable MOC frontend if --framework is not specified

* Ready for review

* Fix: don't use FrontEndManager if framework is not in list of available frontends

* Apply review comments
2021-08-10 09:23:30 +03:00
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