Commit Graph

130 Commits

Author SHA1 Message Date
Pavel Esir
29612f15e3 Fix StridedSlice replacer order and input permutation when strides are not specified (#4545) 2021-03-03 11:16:56 +03:00
Svetlana Dolinina
42c1c65454 fix calculation of memoryoffset shape (#4533)
* fix calculation of memoryoffset shape in 2 cases: after normalization layer (shape can be read from InputDim in loader) and after affincecomponent layer (shape saved in out-size based on weights shape)

* improve comments
2021-03-02 14:35:22 +03:00
Anton Chetverikov
7770701fe8 Update pooling extender for 3D cases (#4504)
* Update pooling extender for 3d cases

* Update error message
2021-03-01 18:54:47 +03:00
Gleb Kazantaev
1bdccb41df Telemetry for IE dependency warnings (#4431)
* Initial telemetry for IE dependency warnings

* Unified MO/IE version extraction; updated telemetry messages to use simplified versions

* Update telemetry

* Renamings; improvements; comments

* Turn On telemetry

* Added tests

* Added versions_mismatch flag

* plarform -> system
2021-03-01 13:30:40 +03:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Yegor Kruglov
870a6c061a Fix of ascii decode problem in TF Const with string value (#3672)
* added try/except to tf_tensor_content

* code refactoring

* added unittest

* update test
2020-12-27 22:15:17 +03:00
Evgeny Lazarev
c6bfac6e05 Enable TF 2.0 Object Detection API models (#3556)
* Config for TF 2.0 Faster R-CNN models, refactored subgraph_between_nodes to use graph API

* Added support for new type of Preprocessing block in the TF 2.0 OD API models. Various fixes to enable the Faster R-CNN ResNet 50

* Updated text comments

* Fixed sub_graph_between_nodes for TensorIteratorMerge. Added support for the TF 2.X EfficientDet models (not yet reshape-able)

* Fixed unit tests

* Fixed regression for TF 1.X OD API SSD model, enabled TF 2.0 OD API SSD models

* Code clean up

* Switched TF 2.0 OD API Faster R-CNN to preprocessor replacement type 2

* Refactored ObjectDetectionAPIPreprocessorReplacement and ObjectDetectionAPIPreprocessor2Replacement

* Fixed bug in the Div transformation to Mul when input is integer.

* Added support for the TF 2.0 OD API Mask R-CNN

* Added unit tests for Div operation. Updated incorrectly modified mask_rcnn_support_api_v1.14.json

* Updated document with list of supported configuration files for TF OD API models

* Review comments

* Added tests for control flow edges for the sub_graph_between_nodes function

* Two more tests
2020-12-21 14:21:39 +03:00
Anton Chetverikov
129a6553fa soft_get fix (#3662) 2020-12-21 14:05:41 +03:00
Anton Chetverikov
a788c02c3d Actualize operations attributes (#3613)
* Fix missed/redundant attrs for some operations

* Align auto_pad attr values in spec

* Update MO IR Reader extenders for appropriate operations

* Allign auto_pad attr values for appropriate operations

* Remove changes in extenders

* Update backend_attrs for some operations

* Changes in shape_infer functions to correct work with explicit mode

* Apply offline comments
2020-12-18 11:47:41 +03:00
Anton Chetverikov
ab996da912 Update port renumbering logic for constants (#3578)
* Update port renumbering logic for constants

* Resolve comments
2020-12-15 21:39:56 +03:00
Eugeny Volosenkov
6f512142b6 Re-implement onnx old-style extractors with extractor extensions (#3459)
* add class ConcatFrontExtractor for onnx

* add class ConcatFrontExtractor for onnx

* Delete concat from mo/front/onnx/extractor.py

* Add identity, reshape extractors classes for onnx

* import FrontExtractorOp

* Added BatchNormalizationExtractor

* Added extra line

* Fix import modules

* fix caffe bn.py and bn_test.py

* Fix BatchNormInference

* Modify convert_batch_norm

* Modify convert_batch_norm

* Modify bn_test.py

* Fix old comments BN->batchNormInference
2020-12-10 09:24:24 +03:00
Eugeny Volosenkov
b3124a5c77 Fix issue with np.expand_dims for numpy<18.x (#3436)
* Fix trouble with np.expand_dims for numpy<18.x

* Delete function expand_dims

* Added additional line
2020-12-03 09:48:17 +03:00
Maxim Vafin
500a95d960 Fix shape inference for Transpose nodes inserted by ApplyPermutes (#3348) 2020-12-01 11:54:29 +03:00
Pavel Esir
1076d32467 [MO] cli_parser fix when input contains substring with matching scale/mean values (#3146)
* fix MO cli_parser when input contains substring with matching scale/mean values

* some additions to cli_parser unit-tests

* fixed numpy array comparisons -- added assert_ prefix

* more general solution for mean/scale cli_parser, names with only digit values are processed correctly

* minor corrections
2020-11-20 11:42:42 +03:00
Vladimir Gavrilov
3aed19a46a XLNET models bugs (#1199)
* Started to write equality comparator for StridedSlice layers.

* Now considered only unique StridedSlice consumers of non-constant data nodes.

* Fixed test for the transformation ConvertGroupedStridedSlice.

* Deleted commented code.

* Small fixes.

* Moved functions unique_by and group_by_with_binary_predicate to mo/utils/utils.py.

* Deleted function collect_sequences.

* Added asserts into the constructor of StridedSlice.

* Written test for the case when 1) there are 4 StridedSlice operations; 2) 2 of StridedSlice have the same data; 3) 2 others StridedSlice have the same data; 4) all StridedSlice operations outputs are consumed by different operations.

* Added some comments.
2020-11-19 10:07:30 +03:00
iliya mironov
9cb3c2a6be Fix graph clenup (#3159)
* Fix graph clenup

* Refactoring graph clean up function

* Change wa comment

Co-authored-by: Your Name <you@example.com>
2020-11-17 16:28:27 +03:00
Maxim Vafin
a991ad926f Fix ApplyPermutations for the case when more then 1 input with permutes (#3095) 2020-11-17 11:58:01 +03:00
Roman Kazantsev
10b18a00c6 Improve reshapeability of models with eltwise nodes influencing shapes (#2767)
* Fix ElementwiseInputReshape transformation

Reshape node always needs to be inserted
in order to preserve ShapeOf nodes (reshapability of a model) that can potentially be above
elementwise node.

Refactor EltwiseInputReshape_test and EltwiseInputNormalization_test since the logic of maintaining reshape for eltwise has been changed.

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

* Merge EltwiseInputNormalization and EltwiseInputReshape transformations

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

* Remove Unsqueeze from Fused_op

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

* Fix code after code review #1

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

* Fix code after review #2

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

* Fix code review #4

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

* Perform full normalization based on shapes of all inputs to eltwise

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

* Refactor much to avoid old API and edges with unsqueeze_dims attribute

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

* Fix code after review

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2020-11-16 09:50:41 +03:00
Maxim Vafin
9f0b26e14c Fix the NHWC->NCHW transformation for dynamic weights (#2848)
* Fix the NHWC->NCHW transformation when weights and data comes from same input

* Simplify code
2020-11-06 19:04:46 +03:00
Evgeny Lazarev
67e039340e Added support for the Loop operation in the MO IR Reader (#2971)
* Added support for the Loop operation in the MO IR Reader
2020-11-05 20:53:44 +03:00
Evgeny Lazarev
c8dd831fc3 Added transformation config to support automl efficientdet models (#2894)
* Added transformation config to support automl efficientdet-4 model

* Added configuration file to convert Automl EfficientDet model

* Updated unit test for Pack

* Added instruction on how to convert EfficientDet Tensorflow model

* Updated documentation on how to convert EfficientDet model

* Updated a documentation with instruction on how to convert Automl EfficientDet.
2020-11-02 19:21:05 +03:00
Sergey Lyubimtsev
93342f0860 [MO] Add CMake install for Model Optimizer (28291) (#2831)
* [MO] Add CMake install for Model Optimizer

* [MO] Update test for version.py

* [MO] Add CMake install for Model Optimizer

* [MO] Update test for version.py

* [MO] Add CMake install for Model Optimizer

* [MO] Update test for version.py

* [MO] fix file permissions for install location
2020-10-30 14:37:06 +03:00
Evgeny Lazarev
cabf8d8534 ONNX Loop operation support (#2756)
* Generate TensorIterator without back edges from TensorFlow models

* Added a check in the MarkSubgraphsWithCorrectLayout to not fail when port is not connected

* Updated the 'protobuf2nx' to consume the graph protobuf message

* Cleanup TI from the IRv7 specific code

* Do not run some front transformations recursively

* Draft support for the ONNX Loop operation when 'cond' = True

* LoopToTI transformation changes

* Added draft of Loop operation and parser for ONNX Loop operation body

* Updated Loop body parser + added shape and type infer for the Loop operation

* Fixes for ONNX Loop operation parser

* Moved Loop parsing to Loop op extractor. Added generation of external edges for the Loop body ops

* Added support for ThresholdedRelu using decomposition

* Added support for Min ONNX operation

* Draft fixes for port_map generation for the Loop

* Rename transformation file and fix BOM

* Fixed shape inference for Loop scan outputs (axis is not None)

* Fixed shape inference for ONNX Loop operation

* Refactor checks in the TensorIteratorMerge transformation

* Code refactoring. Enabled commented transformations

* Documentation update for ONNX Loop, ThresholdedRelu and Min

* Fixed typo in the Loop front transformation where execution condition input is connected. Other refactorings

* Fixed in the Loop extractor

* Added printing 'internal_layer_id' attribute in the graph dumper

* Updated calculation of iterations number for the Loop

* Added missing code

* Fixed output port shapes and types generation for Loop operation

* Update function names and variable names in the Loop operation

* Fixed type inference for iteration count input

* Added removal of input/output ports of the Loop if they are not used

* Fixed renumbering Loop operations input/output ports to keep mandatory

* Fixed ThresholdedReluDecomposition transformation

* Updated MO IR Reader to know about Loop operation. But it is still not supported by the MO IR Reader

* Added unit test for Slice op shape infer (reverse the sequence of elements)

* Reverted changes in the ONNX loader function call to protobuf2nx

* Enable Reshape0DToSqueeze transformation recursively

* Refactored Loop operation support implementation

* Changed ThresholdedReluDecomposition to generate Const with shape [1] instead of scalar

* Code style and wording fixes

* Restored accidentally removed 'return' statement in the TI shape infer function

* Fixed comments

* Fixed comment

Co-authored-by: Evgeny Lazarev <elazarev.nnov@gmail.com>
2020-10-27 23:04:43 +03:00