Commit Graph

251 Commits

Author SHA1 Message Date
Pavel Esir
162bdde251 [MO][TF] Fixed TFSliceToSlice conversion error on Win (#4367)
* [MO][TF] Fixed TFSliceToSlice conversion error on Win, replaced int32_max with ShapeOf, minor correction in comments

* review apply: added create_op_with_const_inputs

* review apply: renamed variables, updated typehints for int64_array, float_array, float32_array

* renamed to correct_ends

* returned back check_op_attrs=True
2021-02-24 16:34:43 +03:00
Evgeny Lazarev
5fa1e2140e Temporary disable telemetry (#4449) 2021-02-24 13:27:10 +03:00
Svetlana Dolinina
5ee00a989f add string constants '0'/'1' to bool normalizer (#4402)
* add string constants '0'/'1' to bool normalizer

* fix bug
2021-02-24 13:17:32 +03:00
Evgeny Lazarev
7420bb6cb0 Fix pad op with int input (#4438)
* 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

* Added OV_ITT_SCOPED_TASK for ConvertLike constant folding
2021-02-24 09:56:36 +03:00
Maxim Vafin
bf6b061709 Fix MVN in MO (#4311)
* Fix MVN in MO

* Apply feedback and add test

* Remove unneeded import

* Apply review feedback

* Apply review feedback

* Fix issue with class name
2021-02-20 11:11:51 +03:00
Yegor Kruglov
7e3289cc58 added condition for removing input ports (#4396) 2021-02-20 10:26:37 +03:00
Anton Chetverikov
8c79d4134f Update Convert extender (#4409)
* Update Convert extender

* Update copyright year
2021-02-19 20:50:46 +03:00
Gleb Kazantaev
5d647e6fab Add IE Python Dependency To MO (#4151)
* Added script that check IE existance

* Updated install_prerequisites.sh to check and insall IE python dependency

* Execute MOC transformation pipeline in subprocess

* Updated path to offline_transformations.py

* Updated IE dependency search; added libs search support

* Updated install_prerequisites.bat to check IE dependency

* Print warning if MO and IE versions do not match

* Set env before subprocess run

* Add mean and meta info to serialized IR

* Fix pylin import issue

* Update BOM file; added intel headers

* use default serialization; code style fix

* Codestyle

* Added subprocess timeout

* Check e2e status

* Update install_prerequisites.sh logic

* Update MO version to be generated even without cmake execution

* Update install_prereq to extract release version from python

* Simplify pyhton code

* Reduce memory consumtion to its original value

* Added OV find and search logic for windows batch script

* Remove model reading to avoid excess memory consumtption

* IMproved logging messages; simplified code

* Improved warnign message incase when MO and IE versions mismatch

* Fix test import

* Check IE bindings in the beginnig of MO pipeline

* Changed warning message; added RelWithDebInfo path

* Recomendation to build IE from source

* Resolve PR comments

* Apply review comments; Added CheckAPI pass

* Added path to IE local libs

* ModelOptimizer -> Model Optimizer (+IE)

* OpenVINO -> OpenVINO (TM) Toolkit

* Updated install_prerequisites.bat with new logic

* Move offline_transformations.py to back folder; improve warning mesages experience

* Update install_prerequisites.bat

* Move back some unnecessary changes

* Fix BOM

* Disable import errors for pylint

* Fixed grammar in messages

* pylint disable import error

* Final grammar fixes in bat and sh files
2021-02-19 14:13:20 +03:00
Pavel Esir
7dca134031 [MO] [TF] Added TF broadcast_to extractor (#4376)
* Added TF broadcast_to extractor

* updated Supported_Frameworks_Layers.md

* corrected name

* corrected op name in Supported_Frameworks_Layers.md

* added a space after BroadcastTo in Supported_Frameworks_Layers.md
2021-02-19 11:44:11 +03:00
Vladimir Gavrilov
2b732ec1d7 Incorrect type of 'scales' input of the operation Interpolate-4 in some cases (#4375)
* Commit.

* Fixed element type of scales input in the MO transformation UpsampleToResample.

* Fixes in the transformation TFSliceToSliceReplacer.

* Fixes in tests.

* Small fixes.

* Reverted fixes in TFSliceToSliceReplacer.

* Small fix.

* Added tests for fractional scales in the transformation UpsampleToResample.
2021-02-19 10:52:41 +03:00
Anton Chetverikov
2c4afd8cd4 Tensor names support in MO IR Reader (#4194)
* Added attributes save modes

* Added tensor names to IR

* Reformat code

* Add support for tensor names in MO IR Reader

* Unit tests and code refactoring

* Fixed error

* Code refactoring

* Code refactoring

* Code refactoring

* Error fixed

* Error fixed

* Bug fixed

* Bug fixed

* Additional unit tests and comments

* Small update

* Update fake infer function

* Update names restoring

* optimize imports

* Add support for old-style constants and for commas in reader

* Added dest mode in Fuse Mul

* Update default values

* Fix missed debug info in some specific cases

* Fix a lot of issues with missedand wrong names provoding

* Resolve review comments

* Update test IR's

* Refactor and simplify code

* More simplification

* Remove unneccessary changes

* model-optimizer/mo/utils/ir_reader/layer_to_class_test.py

* Add separate tests for names restoring

* Update copyright year

* Apply review comments

Co-authored-by: Anastasia Popova <anastasia.popova@intel.com>
2021-02-18 10:38:04 +03:00
iliya mironov
f670b7cb3a Add CTCGreedyDecoder mo support (#4009)
* Add CTCGreedyDecoder mo support

* Update copiright

* Update bom file

* Add transformation

* Fix code style

* Fix according to review

* Add CTCGreedyDecoder v6 to ConvertPrecision

* Hot fix

* Add replasment for ctc_greedy_decoder

* Fix test

* Fix

* Update ie transform

* Draft ctc lost replaser

* Add ctcloss replaser

* Update

* Refactoring code

* Update transformation

* Update decoder

* Remove comments

* Convert seq mask from int to float

* Fix unit test

* Add dynamic tests

* Refactoring code

* Fix py code style

* update style

* Disable ctcgreedydecoder transform for mkldnn plugin

* Add some comments

* Add transfor code comments

* Enable transform from differend plagins

* Fix mo

* fix tests

* Fix comment

* Fix convert precition

* Update comment

* Fix prcition

* Refactoring according to reviw

* Add ir reder extender

* Rename transformation

* Update bom file

* Fix mo replacer

* Fix tests

* Move transform to decomp

* Add check blank_index

* Rafactoring ctcloss

* Change dinemic rank check

* Fix ctclos extractor

* Remove comment

* Fix code style

* Refactoring pattern matcher for transformation CTCGreedyDecoder

* Disavle transform for vpu

* Refactoring according to review

* Refactoring code

* Disable transformation for cldnn

* Remove unused code

* Reverse transfomation

* Fix code style

* Hot fix transform

* Fix unit tests

* Update transform

* Enable transform in common pipline

* Fix names replasments for mo transformations

* Hot fix

* Fix
2021-02-17 14:38:51 +03:00
Evgeny Lazarev
f8f60b2d83 Stick requirement version of astroid to be 2.4.2. Also fixed pylint issue with astroid==2.5 (#4365) 2021-02-16 21:34:51 +03:00
Pavel Esir
22169a05b9 [MO] StridedSlice improvements (#4139)
* fix ss

* successfully converted

* successfully run moved infer and normalizer unit-tests

* successfully rewritten StridedSlice infer unittests

* int64 array

* Successfully converter crash-when-loading, xj_feauture and toy nets (cherry-picked maxpoolV4 and tf_broadcast_ext)

* successfully moved PermuteAttrs to general mechanism

* successfully converted xj_feauture and crash when loading with the new rewritten SS infer

* fixed get_shape_from_slice and moved to common utils

* fixed extending masks and some other

* some refactoring

* fixed extending masks in extractor, fixed licence year and some other code clearing

* corrected a couple of unittests

* fox permute for 5 rank slice and 4 rank inputs/

* WIP

* Added comments

* fixed StridedSlice in ProposalMutation.py

* rechecked shape_infer unittests added some new cases

* added shape_infer unit-tests after StridedSliceNormalizer pass and Permute unit-tests

* corrected unittests

* Applied review comments

* general permutations for inputs implemented, corrected ellipsis unrolling when shrink_axis is at the beginning, some other corrections

* removed code duplication in infer and normalizer, moved 'slices' attr normalizing to StridedSliceNormalizer.py

* removed some code duplication and other minor improvements

* Added tests

* minor corrections

* wider range of unittests added (froze the number)

* review comments applied

* enabled skipped unit-test

* comment corrections

* applied review comments: changed op -> type, added some asserts, corrected comments and other minor corrections

* sorted inputs, updated Supported_Frameworks_Layers.md, some minor
2021-02-16 11:48:49 +03:00
Anastasia Popova
eeb7835128 Result rename operation (#4242)
* Added result rename operation

* Optimize imports

* Added ResultRename to package_BOM

* ResultRename moved to the end of back phase, code refactoring

* Revert incorrect changes

* Optimize imports

* Added comments and optimized imports.
2021-02-12 22:44:21 +03:00
Evgeny Lazarev
bdc0dcfcf5 Fixed bom file and updated unit test (#4309) 2021-02-12 14:47:18 +03:00
Maxim Vafin
d91b9fd8da Fix backward compatibility of MVN in MO (#4289) 2021-02-11 22:36:31 +03:00
Evgenya Stepyreva
08ac8d9af9 Reverse input channels fusion (#4276)
* Side fix found while working on Windows machine.

* Fix for non-fused Reverse Input Channels subgraph
2021-02-11 14:27:08 +03:00
iliya mironov
0341edcfa0 Update mxnet version (#4081) 2021-02-10 17:19:06 +03:00
Evgeny Lazarev
66f4c69b90 Telemetry sender and MO instrumentation (#3804)
* Draft implementation of the telemetry sender utility

* Examples of sending telemetry from the MO

* More statistic about the model.

* Intentional broken file to fail Mask-RCNN ONNX model conversion

* Added joined list of ops used

* Added requests to the requrements file and update BOM to include necessary files related to telemetry

* Send telemetry alwasys

* Refactored usage of GUID usage in the telemetry

* Enabled sending telemetry always

* Simplified function "TelemetryBackend.send"

* Use other approach to send information about session to GA

* Added automatic registration of the telemetry backends and allow to choose it during the telemetry class instantiation

* Added "requests" as a requirement. Wrapped usage of requests module to not crash the app

* Added timeout for sending data to GA. Increased the queue size to 1000

* Finalize Telemetry class implementation

* Do not fail MO if non-critical component is not installed and updated Telemetry GA with the default property

* Added sending version to a separate event

* Use default TID to send the data

* Set lower bound for the requests module which does not contain vulnerabilities

Co-authored-by: Evgeny Lazarev <elazarev.nnov@gmail.com>
2021-02-10 10:51:31 +03:00
Maxim Vafin
deca4fc443 Fix wrong attributes for Pad (#4216) 2021-02-09 14:11:39 +03:00
Anton Chetverikov
c1a606d507 Update L2NormToNorm transformation (#4154)
* Removechanges added by mistake

* Update transformation

* Refactor tests, add more cases

* Rename variable

* Refactor and rename transformation

* Update tests, add more cases
2021-02-09 14:07:08 +03:00
Dmitry Navalny
14d3310b32 [MO] pip packaging (#3123)
* [MO] pip packaging

* Use subprocess

* Remove MANIFEST.in

* Fix comments

* Fix requirements.txt duplication

* Add license
2021-02-09 10:47:14 +03:00
Roman Kazantsev
636f5c44b0 [MO] Support TF2 Keras ConvLSTM2D operation (#4197)
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2021-02-09 10:11:38 +03:00
Ivan Tikhonov
6789c158fd New versions of Assign/ReadValue ops (#4055)
* new versions of assign/read value, squashed commits

* Assign/ReadValue base classes, code style

* update ie_ir_parser and conversion

* low latency transformation update to support Loop op

* ngraph code style

* fix build, refactoring

* fix unit tests

* fix unit tests again

* fix unit tests

* fix code style

* update comments

* ngraph codestyle

* fix low latency tests

* fix failed unit tests

* fix incorrect version of submodule

* fix review remarks

* ngraph code style

* fix ngraph tests

* fix low latency unit tests
2021-02-09 09:50:55 +03:00
Pavel Esir
7eac2a1452 [MO][TF] Add Tensorflow Pooling V2 (#3911)
* [MO][TF] Add Tensorflow Pooling V2

* corrected extractor

* applied review comments

* remove empty line in PoolV2ToAttributedPool.py

* MaxPool attributes extraction fix
2021-02-09 09:46:32 +03:00
Maxim Vafin
a157cc2a55 Support ":" in node name for mean/scale application (#4082)
* Support ":" in node name for mean/scale application

* Apply review feedback
2021-02-08 16:51:53 +03:00
Ryan Loney
56b6e1065b Update install_prerequisites.bat (#4205)
* Update install_prerequisites.bat

Removed warning language to show that you can optionally install protobuf to speed up model conversion. It should not be a warning.

* Update install_prerequisites.bat
2021-02-07 10:13:44 +03:00
Anastasia Popova
cfc3b563a5 Tensor names in IR (#4089)
* Added attributes save modes

* Added tensor names to IR

* Reformat code

* Unit tests and code refactoring

* Fixed error

* Code refactoring

* Code refactoring

* Code refactoring

* Error fixed

* Error fixed

* Bug fixed

* Bug fixed

* Additional unit tests and comments

* Added dest mode in Fuse Mul
2021-02-06 09:31:47 +03:00
Vladimir Gavrilov
c1136cd7b0 Completely transition of MO to Interpolate-4 (#970)
* Refactored infer function and function supported_attrs for the layer Interpolate.

* Small change.

* Deleted unneeded checks in transformations ResizeToInterpolate2D and ResizeToInterpolate3D.

* Small fix in the extractor of ONNX Resize.

* Now the extractor of TF ResizeBilinear generates Interpolate-1 again, because 'axis' in final version of Interpolate-4 specification is an input but is not attribute.

* Now the extractor of TF ResizeNearest generates Interpolate-1 again, because 'axis' in final version of Interpolate-4 specification is an input but is not attribute.

* Added static method get_axis into class Interpolate.

* Refactored class CanBeFused in the transformation InterpolateSequenceToInterpolate.

* Fixed transformation InterpolateSequenceToInterpolate according to the last version of the specification of Interpolate-4.

* Started to write support of Interpolate-4 in the transformation InterpolateWithConcat.

* Added support for Interpolate-4 into the transformation InterpolateWithConcat.

* Added support for Interpolate-4 into the transformation InterpolateConcat.

* Added support for Interpolate-4 into the transformation InterpolateReshapeWA.

* Added support for Interpolate-4 into the transformation InterpolateTranspose.

* Started to add test for opset4 case of the transformation InterpolateSequenceToInterpolate.

* Added test for InterpolateSequenceToInterpolate (test_2d_interpolate_sequence_1_opset4_case).

* Added test for InterpolateSequenceToInterpolate (test_2d_interpolate_sequence_4_opset4_case).

* Added another test for InterpolateSequenceToInterpolate (test_2d_interpolate_sequence_5_opset4_case).

* Added another test for InterpolateSequenceToInterpolate (test_3d_interpolate_sequence_1_opset4_case).

* Finished addition of tests for opset4 case of InterpolateSequenceToInterpolate.

* Small change.

* Now opset is only opset1 or opset4 in the transformation InterpolateTranspose.

* Small fixes in transformations ResizeToInterpolate2D and ResizeToInterpolate3D.

* Deleted reading of unused ONNX attributes.

* Fixed docstring of the transformation InterpolateV1ToInterpolateV4.

* Added node name in assert about axes input.

* Fixes in the definition of the operation ONNXResize11.

* Now Interpolate-4 cannot have 'extension' as opset.

* Now the transformation InterpolateV1ToInterpolateV4 uses find_and_replace_pattern but not replace_sub_graph.

* Fixed tests for transformations InterpolateReshapeWA and InterpolateConcat.

* Fixed some tests.

* Rewritten operation Interpolate-4 class according to new variant of documentation.

* Some fixes in ONNXResize11 operation class.

* Now the transformation ONNXResize11ToInterpolate generates Interpolate-4 with 4 inputs.

* Now the transformation UpsampleToResample generates Interpolate-4 with 4 inputs.

* Now the transformation NearestNeighborUpsampling generates Interpolate-4 with 4 inputs.

* Now transformations ResizeToInterpolate2D and ResizeToInterpolate3D generate Interpolate-4 with 4 inputs.

* Now the transformation SplitConcatPairToInterpolate generates Interpolate-4 with 4 inputs.

* Now the transformation UnsqueezeTileReshapeBlockToInterpolate generates Interpolate-4 with 4 inputs.

* Now the transformation InterpolateV1ToInterpolateV4 generates Interpolate-4 with 4 inputs.

* Some fixes.

* Fixed the transformation InterpolateSequenceToInterpolate according to new variant of Interpolate-4 specification.

* Fixed typos.

* Added shape_calculation_mode to supported_attrs.

* Small fixes.

* Added operation ONNXResize10 and the transformation ONNXResize10ToInterpolate4.

* Fixed function correct_scales_using_dst_shape.

* Some fixes in InterpolateSequenceToInterpolate.

* Fixed bug in the method __call__ of the class CanBeFused: now self.accumulated_axes is correctly cleared in all cases.

* Small change.

* Fixed tests for the transformation SplitConcatPairToInterpolate.

* Now transformations InterpolateWithConcat, InterpolateReshapeWA, InterpolateConcat support Interpolate-4.

* Fixed the transformation InterpolateTranspose for the case of Interpolate-4.

* Written the back transformation InterpolateV4AxesCorrection to convert 'axes' input of Interpolate-4 from NHWC to NCHW layout.

* Added PermuteInput in Interpolate-4 infer.

* Fixed typos.

* Deleted the transformation InterpolateAxesCorrection.

* Now Interpolate-4 permutes axis, not shape in input port 3.

* Small fix.

* Some fix.

* Fixed bug in the transformation UpsampleToResample.

* Added some debug prints.

* Added more debug prints.

* Now ONNX Upsample-9 operation is read as ONNXResize10.

* Small fix.

* Small fixes.

* Fixed tests for the transformation SplitConcatPairToInterpolate.

* Deleted debug prints.

* Deleted some debug prints.

* Fixes in the transformation UnsqueezeTileReshapeBlockToInterpolate and its tests.

* Small fix in the transformation InterpolateSequenceToInterpolate.

* Started to write nGraph transformation to convert Interpolate-1 to Interpolate-4.

* Deleted redundant files.

* Small fixes.

* Small fix.

* Written draft of the transformation Interpolate-1 -> Interpolate-4.

* Small fix.

* Now ONNX Importer reads Resize-10 as Interpolate-4.

* Fixes in the test onnx_model_resize10_import_only.

* Small fix in the test for the conversion Interpolate-1 -> Interpolate-4.

* Small fixes.

* Fixed NGraphReaderTests for Interpolate.

* Some fixes.

* Deleted class for Resample operation.

* Fix in the transformation NearestNeighborUpsampling: fixed precision of the input 'scales' of generated Interpolate-4.

* Fixed typo.

* Now the TF operations ResizeBilinear is readed as internal MO operation TFResizeBilinear. This internal operation is converted into Interpolate-4.

* Small fix in BOM-file.

* Added checks of existence of attributes of TF  ResizeBilinear operation.

* Small fixes in the conversion of the internal MO operation  TFResizeBilinear to Interpolate-4.

* Small fixes.

* Small fixes.

* Now the transformation ONNXResize10ToInterpolateV4 calculates sizes input as input_shape * (scales + epsilon).

* Added the internal MO operation TFResizeNearestNeighbor.

* Fixes in the transformation SplitConcatPairToInterpolate and its tests.

* Fixes in the transformation UnsqueezeTileReshapeBlockToInterpolate and its tests.

* Written the transformation that converts the internal operation TFResizeNearestNeighbor into Interpolate-4.

* Now MO reads the TF operation ResizeNearestNeighbor as the internal MO operation TFResizeNearestNeighbor.

* Small fix.

* Now the specification of Interpolate-4 clarifies that the mode linear_onnx supports only 2D or 4D input tensors.

* Small fix.

* Some fixes.

* Moved the transformation ONNXResize10ToInterpolateV4 to the front stage.

* Deleted infer function and function supported_attrs for ONNXResize10 operation.

* Deleted supported_attrs() for TFResizeBilinear and TFResizeNearestNeighbor.

* Some fixes.

* Fixes in the shape infer function of the nGraph operation Interpolate-4. Now 'axes' input can be non-constant.  In the such case, all elements of the output shape are Dimension::dynamic().

* Deleted corner cases processing in transformations TFResizeBilinearToInterpolateV4 and TFResizeNearestNeighborToInterpolateV4.

* Rewritten the function replace_resize_bilinear.

* Written inner MO operation TFResize that covers TF operations ResizeBilinear and ResizeNearestNeighbor.

* Now TF operations ResizeBilinear and ResizeNearestNeighbor are read as an internal operation TFResize in MO. Transformations TFResizeNearestNeighborToInterpolateV4 and TFResizeBilinearToInterpolateV4 are fused into one transformation TFResizeToInterpolateV4.

* Some changes in the shape infer function of nGraph op Interpolate-4.

* Small fix.

* Some changes.

* The transformation TFResizeToInterpolateV4 is moved to the front stage.

* Deleted redundant assert.

* Deleted transformations ResizeToInterpolate2D and ResizeToInterpolate3D.

* Some renaming.

* Small change.

* Deleted .copy() in the shape infer function of the internal operation TFResize.

* Small fix.

* Small fixes.

* Added comment about the case when the input 'axes' of Interpolate-4 is non-constant.

* Written test for Interpolate-4 shape infer, for the case when the input 'axes' is non-constant and shape_calculation_mode = scales.

* Some fixes.

* Small fixes.

* Small fix.

* Added yet another test for the case of non-constant 'axes' input of Interpolate-4 (when shape_calculation_mode = sizes).

* Added some comment.

* Small fix.

* Reverted changes for InterpolateWithConcat.

* Added type checks for all inputs of nGraph operation Interpolate-4.

* Added u32 and u64 to supported element types of sizes and axes inputs of nGraph operation Interpolate-4.

* Fixed some functional tests.

* Some changes.

* Added helper function float32_array.

* Now the MO transformation InterpolateV1ToInterpolate preserves names of layers.

* Small fix.

* Small fix.

* Reverted some change.

* Small fixes.

* Small fix.

* Small fix.

* Small fix.

* Small fix.

* Reverted changes in the nGraph reader tests for Interpolate-1.

* Some revert.

* Fixed some copyright year.
2021-02-05 19:20:26 +03:00
Maxim Vafin
08a527602f Extend LayerNorm pattern to support onnx bert (#4137)
* Extend LayerNorm pattern to support onnx bert

* Fix test

* Fix test
2021-02-05 14:26:24 +03:00
Edward Shogulin
f57f1fafc7 [LPT] Q/DQ support integration (#3575)
* [ MO ] New INT weights form

	Ticket #34096

	FQ = Quantize -> Dequantize =
	= FQ` -> Convert(int8) -> Convert(src_dtype) -> FQ =
	= Constant(int8) -> Convert(src_dtype) -> FQ =
	= Constant(int8) -> Convert(src_dtype) -> Subtract(zero_point) -> Multiply(scale)

* [LPT] Q/DQ representation support

Co-authored-by: Evgenya Stepyreva <evgenya.stepyreva@intel.com>
2021-02-03 17:05:34 +03:00
Anton Chetverikov
1b8930c4cb Remove redundant attributes in back_edges for TI and Loop layers (#4133)
* Remove redundant edge attrs for loop layer

* Update copyright year
2021-02-03 14:50:47 +03:00
Maxim Vafin
75763b8e67 Extend GELU merger patterns (#4130) 2021-02-02 17:59:12 +03:00
Maxim Vafin
0b3ff5edc2 Add MO support for MVN-6 (#3772)
* Add MO support for MVN-6

* Apply review feedback

* Apply review feedback

* Enable MVN-6 decomposition

* Fix shape_infer issue

* Fix MVN6 decomposition

* Fix build

* Fix tests

* Small fix

* Add MVN-6 reader test

* Apply feedback

* Apply review feedback

* Fix onnx test failure
2021-02-02 17:45:56 +03:00
Roman Kazantsev
5ab628d776 Fix TF2 Keras RNN support (#4116)
It adds support for Bidirectional RNNs and avoids use of ONNX primitives from MO-TF.

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2021-02-02 16:00:11 +03:00
Eugeny Volosenkov
1a787cb3ba Re-implement caffe old-style extractors with extractor extensions (#3675)
* move crop extractor

* Add concat_ext.py

* Add roipooling_ext.py

* Add roipooling_ext

* Add scale extractor

* Add scale extractor

* Add bn_ext.py and dropout_ext.py

* Add bn_ext.py and dropout_ext.py

* Add bn_ext.py and dropout_ext.py

* Fix bn.ext.py

* Sort fix

* Fix bn_test.py

* rename to batchnorm_ext

* Add bn_ext

* Fix batchnorm_ext.py

* small fix

* Small fix
2021-02-01 13:17:17 +03:00
Anna Likholat
a6a5635a59 added log extractor for tf (#4090) 2021-02-01 11:26:03 +03:00
Evgeny Lazarev
3669205a44 Added support for the MxNet op take (#4071) 2021-01-29 15:48:33 +03:00
Anton Chetverikov
6b54e738d7 Update operation attributes (#3814)
* Allign attribute values in spec

* Fix wrong attribute name in spec

* Add `get_boolean_attr` function

* Add get_type function

* Update conv attrs

* Update copyright year

* Add missed attrs, update copyright year

* Fix year in copyright

* Update ir parser for RegionYolo layer

* Remove wrong changes for BinaryConvolution

* Remove get_type function as it no more needed

* Update check for reduce ops

* Fix error in reduce attrs

* Update ir_engine to work with bool attrs

* Update DetectionOutput operation

* Update PSROIPooling

* remove redundant attrs from spec

* Update get_boolean_attr function

* Update Reduce operations

* Update DetectionOutput specification

* Update specification for missed attrs

* Apply comments

* Fixconst renumbering logic

* Fix typo

* Change default value to fix broken shape inference

* Add additional asserts

* Add comment

* model-optimizer/mo/utils/ir_reader/layer_to_class.py

* Sort imports

* Sort imports

* Update year in copyright

* Update const

* Remove changes from const restoring

* Rename function

* remove unnecessary changes

* model-optimizer/mo/front/extractor_test.py

* Fix year in copyright

* Add soft_get

* Fix exclude-pad attribute name for AvgPool operation

* Update exclude_pad attribute values

* Remove useless comment

* Update examples in specification

* Remove file added by mistake

* Resolve comments

* Resolve comments

* Add return value

* Allign global_pool attribute
2021-01-29 10:08:06 +03:00
Anton Chetverikov
a4f28ffe3e Fix restoring constant ops with old numbering (#3951)
* Add check to correct restoring constant ops with old numbering

* Resolve comments

* Update comment
2021-01-25 14:41:30 +03:00
Roman Kazantsev
bacb8420f0 [MO] Implement TensorFlow 2 While and Keras RNN support in MO (#3573)
* [MO] Implement TensorFlow 2 While support in MO

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

* Add extractors for both While and StatelessWhile and do minor changes

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

* Improve update_body_graph function and manage graph names properly

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

* Fix a map for original name of parameters from body and cond

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

* Implement draft version of support of TF2 Keras RNN

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

* Implement Keras LSTM and GRU support in MO

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

* Improve code for Keras RNN support

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

* Finalize implementation of TF2 Keras RNN support in MO

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

* Apply the first part of the comments after review #1

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

* Avoid use of explicit values of port indices in the transformation

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

* Finalize code after the first-round review

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

* Apply comments after the second-round review

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2021-01-21 17:39:57 +03:00
Anastasia Kazantaeva
afb32262c1 Update OV telemetry message for 2021.3 (#3926)
* Update OV telemetry message for 2021.3

* Fixed missprint
2021-01-21 12:48:33 +03:00
Vladimir Gavrilov
318db6eccc Implement ExperimentalDetectronROIFeatureExtractor operation as nGraph op (#3739)
* Commit.

* Written the header file of the nGraph operation ExperimentalDetectronROIFeatureExtractor.

* Started to write cpp-file for the nGraph operation ExperimentalDetectronROIFeatureExtractor.

* Deleted in_ports_count attribute for the MO operation ExperimentalDetectronROIFeatureExtractor.

* Written validate_and_infer_type() method of ngraph::op::v6::ExperimentalDetectronROIFeatureExtractor.

* Code style fixes.

* Code style fixes.

* Small fixes.

* Code style fixes.

* Now operation ExperimentalDetectronROIFeatureExtractor is read as nGraph operation ExperimentalDetectronROIFeatureExtractor.

* Implemented op::v6::ExperimentalDetectronROIFeatureExtractor::clone_with_new_inputs().

* Added macro NGRAPH_OP_SCOPE to the cpp-file of the nGraph operation ExperimentalDetectronROIFeatureExtractor.

* Fixes in some tests.

* Code style fix.

* Fixed yet another test for ExperimentalDetectronROIFeatureExtractor.

* Added tests for reading ExperimentalDetectronROIFeatureExtractor as operation from opset6.

* Added more test for reading ExperimentalDetectronROIFeatureExtractor as operation from opset6.

* Started to write shape infer tests for the nGraph operation ExperimentalDetectronROIFeatureExtractor.

* Corrected ngraph/test/CMakeLists.txt.

* Small changes.

* Code style fix.

* Small fixes.

* Added ctor of ExperimentalDetectronROIFeatureExtractor with NodeVector as argument.

* Added setting the attribute in_ports_count when the MO operation ExperimentalDetectronROIFeatureExtractor is creating in the MO transformation ONNXMaskRCNNTransformation.

* Added shape infer for the second output of the nGraph operation ExperimentalDetectronROIFeatureExtractor.

* Written shape infer tests for nGraph operation ExperimentalDetectronROIFeatureExtractor (case when input shapes are partially dynamic).

* Small fixes.

* Code style fix.

* Deleted redundant &expected_channels.

* Code style fix.

* Small refactoring.

* Small fixes.

* Small changes.

* Small fixes.

* Deleted attribute distribute_rois_between_levels of ExperimentalDetectronROIFeatureExtractoe.

* Deleted attribute preserve_rois_order of ExperimentalDetectronROIFeatureExtractoe.

* Deleted attribute image_id of ExperimentalDetectronROIFeatureExtractoe.

* Now MO generates attribute 'aligned' of ExperimentalDetectronROIFeatureExtractor only with values 'true' or 'false'.

* Small fix.

* Fix in the conversion of the attribute 'aligned' of MO operation ExperimentalDetectronROIFeatureExtractor to string.

* Tabs were replaced by spaces in some XMLs.

* Tabs were replaced by spaces in ngraph_reshape_tests.cpp.

* Fixed copyrights.

* Applied small patch to IREngine from PR https://github.com/openvinotoolkit/openvino/pull/3814.

* Tabs were replaced by spaces in cnn_ngraph_impl_tests.cpp.

* op::v6::ExperimentalDetectronROIFeatureExtractor::validate_and_infer_types() was rewritten using operator & for channels.

* Added tests for input shapes of op::v6::ExperimentalDetectronROIFeatureExtractor in the case when inputs shapes consist of intervals.

* Fixes in test type_prop.detectron_roi_feature_extractor_intervals.
2021-01-20 16:20:54 +03:00
Vladimir Gavrilov
e20a58d770 Implement ExperimentalDetectronDetectionOutput and ExperimentalDetectronPriorGridGenerator operations as nGraph ops (#3374)
* Commit.

* Started to write nGraph operation ExperimentalDetectronDetectionOutput. Written draft of the header file.

* Written draft of the cpp-file for nGraph operation ExperimentalDetectronDetectionOutput.

* Small fix.

* Added reading of ExperimentalDetectronDetectionOutput as nGraph operation.

* Some fix.

* Unregistered old shape infer function of the operation ExperimentalDetectronDetectionOutput.

* Written the header file for the operation ExperimentalDetectronPriorGridGenerator.

* Small refactoring.

* Small fix.

* Added set_output_size(3) into op::ExperimentalDetectronDetectionOutput::validate_and_infer_types().

* Added check for number of inputs of ExperimentalDetectronDetectionOutput.

* Reverted some changes.

* Changed IR for ExperimentalDetectronDetectionOutput serialization test.

* Written cpp-file of nGraph operation ExperimentalDetectronPriorGridGenerator.

* Small fix.

* Some fixes.

* Fixes in type and shape infer functions of the MO operation ExperimentalDetectronDetectionOutput.

* Now ExperimentalDetectronPriorGridGenerator is readed as nGraph operation.

* Fixed the infer function of the nGraph operation ExperimentalDetectronPriorGridGenerator.

* Started to write tests for the shape infer function of the nGraph operation ExperimentalDetectronDetectionOutput.

* Written the draft of the test for the shape infer function of the nGraph operation ExperimentalDetectronDetectionOutput.

* Small fix.

* Fixed ngraph/test/CMakeLists.txt.

* Started to write tests for the shape infer function of the nGraph operation ExperimentalDetectronPriorGridGenerator.

* Now the shape infer function of the nGraph operation ExperimentalDetectronPriorGridGenerator performs correctly case dynamic input shapes with static ranks.

* Continued to write test for the nGraph operation ExperimentalDetectronPriorGridGenerator.

* Small fixes.

* Written tests for the shape infer function of the nGraph operation ExperimentalDetectronPriorGridGenerator (case when input shapes are partially dynamic).

* Added test for reading ExperimentalDetectronDetectionOutput as an operation from opset6.

* Some fixes.

* Added some debug outputs.

* Deleted inserted debug output.

* Small fixes.

* Small fix.

* Small fix.

* Small change.

* Added comments to attributes of ExperimentalDetectronDetectionOutput.

* Reverted changes.

* Deleted shape infer for output port 3.

* Small fixes.

* Deleted redundant keyword 'virtual'.

* Deleted redundant usings in header files of nGraph operations ExperimentalDetectronDetectionOutput and ExperimentalDetectronPriorGridGenerator.

* Some fixes.

* Small change.

* Now GridGenerator::validate takes three args (input partial shapes).

* Small fix.

* Deleted some usings.

* Small code style fix.

* Reverted changes in validate_and_infer_types() and validate() of op::v6::ExperimentalDetectronPriorGridGenerator.

* Added description of the class ExperimentalDetectronDetectionOutput.

* Added some comments into the header file of the nGraph operation ExperimentalDetectronPriorGridGenerator.

* Some fixes.

* Added some comments to the class of the nGraph operation ExperimentalDetectronPriorGridGenerator.

* Now the MO operation ExperimentalDetectronDetectionOutput has the attribute 'version' as 'opset6'.

* Now the MO operation ExperimentalDetectronPriorGridGenerator has the attribute 'version' as 'opset6'.

* Some fixes in the MO class ExperimentalDetectronDetectionOutput.

* Fixes in the shape infer function of the nGraph operation ExperimentalDetectronPriorGridGenerator.

* Renamed test XML model for ExperimentalDetectronDetectionOutput serialization tests.

* Added validation of input shapes for the nGraph operation ExperimentalDetectronDetectionOutput.

* Small fixes in the XML models for serialization testing of ExperimentalDetectronDetectionOutput.

* Added tests of shape infer function of the nGraph operation ExperimentalDetectronDetectionOutput for the case when input shapes are partially dynamic.

* Added tests of shape infer function of the nGraph operation ExperimentalDetectronDetectionOutput for the case when some input shapes have dynamic ranks.

* Small fixes.

* Small fix in the MO operation ExperimentalDetectronDetectionOutput shape infer function.

* Fixes in op::v6::ExperimentalDetectronDetectionOutput::validate_and_infer_types().

* Code style fix.

* Small refactoring.

* Added NGRAPH_OP_SCOPE into ExperimentalDetectronDetectionOutput nGraph class.

* Added NGRAPH_OP_SCOPE to the nGraph class ExperimentalDetectronPriorGridGenerator.

* Small fixes.

* Some refactoring.

* Small fix.

* Small fixes.

* Reverted some changes in ExperimentalDetectronDetectionOutput::validate_and_infer_type().

* Now VPU reads the attribute class_agnostic_box_regression of ExperimentalDetectronDetectionOutput as Bool.

* Now MO generates attribute  'class_agnostic_box_regression' of ExperimentalDetectronDetectionOutput only with values false or true.

* Small fix.

* Tabs were replaced by spaces in some XMLs.

* Fixed copyrights.

* Refactoring in op::v6::ExperimentalDetectronDetectionOutput::validate_and_infer_types().

* Refactoring in op::v6::ExperimentalDetectronPriorGridGenerator::validate_and_infer_types().

* Small fixes.

* Started to write ExperimentalDetectronPriorGridGenerator shape infer tests for the case when dynamic input dimensions are intervals.

* Deleted redundant 'return'.

* Written tests for interval values of input shapes of op::v6::ExperimentalDetectronPriorGridGenerator.

* Code style fix.

* Code style fix.
2021-01-18 12:16:40 +03:00
Anton Chetverikov
d462626826 Update MO extensions enabling/disabling mechanism (#3873)
* Add id for NormalizeToNarmalizeL2 transformation

* Update copyright year

* Update extensions enabling/disabling mechanism

* Remove copyright change

* Copyright year

* Update documentation

* Revert missed year in copyright
2021-01-18 10:32:02 +03:00
Evgeny Lazarev
dbad8809bf MO dev guide refactoring (#3266) (#3595)
* Release mo dev guide refactoring (#3266)

* Updated MO extension guide

* Minor change and adding svg images

* Added additional information about operation extractors. Fixed links and markdown issues

* Added missing file with information about Caffe Python layers and image for MO transformations dependencies graph

* Added section with common graph transformations attributes and diagram with anchor transformations. Added list of available front phase transformations

* Added description of front-phase transformations except the scope-defined and points defined. Removed legacy document and examples for such transformations.

* Added sections about node name pattern defined front phase transformations. Copy-pasted the old one for the points defined front transformation

* Added description of the rest of front transformations and and all middle and back phase transformations

* Refactored Legacy_Mode_for_Caffe_Custom_Layers and updated the Customize_Model_Optimizer with information about extractors order

* Added TOC for the MO Dev guide document and updated SVG images with PNG ones

* Fixed broken link. Removed redundant image

* Fixed broken links

* Added information about attributes 'run_not_recursively', 'force_clean_up' and 'force_shape_inference' of the transformation

* Code review comments

* Added a section about `Port`s

* Extended Ports description with examples

* Added information about Connections

* Updated MO README.md and removed a lot of redundant and misleading information

* Updates to the Customize_Model_Optimizer.md

* More updates to the Customize_Model_Optimizer.md

* Final updates for the Customize_Model_Optimizer.md

* Fixed some broken links

* More fixed links

* Refactored Custom Layers Guide: removed legacy and incorrect text, added up-to-date.

* Draft implementation of the Custom layer guide example for the MO part

* Fixed broken links using #. Change layer->operation in extensibility documents

* Updated Custom operation guide with IE part

* Fixed broken links and minor updates to the Custom Operations Guide

* Updating links

* Layer->Operation

* Moved FFTOp implementation to the template extension

* Update the CMake for template_extension to build the FFT op conditionally

* Fixed template extension compilation

* Fixed CMake for template extension

* Fixed broken snippet

* Added mri_demo script and updated documentation

* One more compilation error fix

* Added missing header for a demo file

* Added reference to OpenCV

* Fixed unit test for the template extension

* Fixed typos in the template extension

* Fixed compilation of template extension for case when ONNX importer is disabled

Co-authored-by: Alexander Zhogov <alexander.zhogov@intel.com>
2021-01-14 16:28:53 +03:00
Roman Kazantsev
7e8cea672e [MO] Implement support of TensorFlow 2 Keras Embedding operation in MO (#3766)
* [MO] Implement support of TensorFlow 2 Keras Embedding operation in MO

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

* Update another requirements files

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2021-01-10 22:05:58 +03:00
Anastasia Popova
c6e57ef99f Fixed regression after mapping bug fix (#3770)
* Fixed regression after mapping bug fix

* Unit test for atribute absence.
2020-12-30 19:41:10 +03:00
Anastasia Popova
631d452258 Fixed mapping of input name (#3737)
* Fixed mapping of input name

* Fixed unit tests

* Fixed mapping of input name

* Fixed unit tests

* attributes check fix

* PEP8 code format

* code duplicate removal

* variable rename
2020-12-28 22:43:54 +03:00