Commit Graph

169 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
Roman Kazantsev
55f1f9606f [MO] Implement transformation to avoid RandomUniform in dropout (#3678)
* [MO] Implement transformation to avoid RandomUniform in a particular drop-out block

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

* Remove old RandomUniform transformation and correct const values

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

* Fix atol value

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

* Move DropoutWithRandomUniform transformation to the front

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

* Change just RandomUniform to Broadcast in the transformation

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

* Correct comment for the transformation

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

* Remove redundant line

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2020-12-25 16:59:15 +03:00
Pavel Esir
d2a23680f2 nGraph 'shell' implementation for GatherElements-6 and MO 'shell' implementation (#3467)
* Initial support of GatherElements in MO and nGraph

* apply_style

* added lost extractor for GatherElements

* Corrected GatherElements::validate_and_infer_types

* updated package_BOM.txt

* Type_t added

* started to implement ngraph shape_type_infer unit-tests

* finally implemented all ngraph shape_inference unit-tests

* updated Supported_Frameworks_Layers.md

* added correct handling of dynamic shapes in nGraph, added unit-tests for dynamic cases, fixed dump typos in MO, replaced axis type from int -> int64_t

* implemented shape infer for dynamic shapes with intervals

* finalized MO implementation

* applied comment from review

* style-apply

* spec correction

* removed conflict

* fixed typos

* removed obsolete comments form type_prop

* significant corrections in validate_and_infer_types

* style-apply

* data_rank check for axis
2020-12-21 15:45:15 +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
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
Yegor Kruglov
98fffe7f22 Possible fix for GroupConvolution unit test (#2584)
* initial commit

* initial commit

* move fix to tf conv_extractor

* added 3d case

* fix e2e with 3d conv

* remove 3d case

Co-authored-by: yegor.kruglov <ykruglov@nnlvdp-mkaglins.inn.intel.com>
2020-12-14 21:30:26 +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
Anton Chetverikov
a7ede592c3 Fix mode attribute value in DepthToSpace ONNX operation extractor (#3466) 2020-12-03 19:33:07 +03:00
Maxim Vafin
bbb7478460 Add support for onnx FasterRCNN model (#3393)
* Add support for onnx FasterRCNN model

* Add documentation
2020-12-01 18:45:08 +03:00
Evgenya Stepyreva
c902eb5df7 [MO] Aligned MatMul-1 with spec (#3337)
* [MO] Aligned MatMul-1 with spec

* removed link to the doc
2020-12-01 13:02:14 +03:00
Yegor Kruglov
ce1ec9eab0 Reshape-able SliceConverter (#3198)
* initial commit

* add cast

* data type fix

* added tests

* added test without axes and steps

* remove redundant imports

* discussions resolving

* Add cast to TFSliceToSlice

* layer tests fix

* update unittest

* rework transformation

* added clamp

* move broadcast

* update unittests

* failed e2e fix

* added comment

* little fixes

* comments update
2020-12-01 12:42:40 +03:00
Evgenya Stepyreva
5ce8946864 [ MO ] Fix for preprocessing insertion on ShapeOf paths (#3243)
* [ MO ] Fix for preprocessing insertion on ShapeOf paths

* ScaleInput tests

* refactoring

* comments
2020-11-25 00:57:03 +03:00
Evgenya Stepyreva
84e775af29 [ MO TF ] TF FakeQuantize normalization fix (#3223) 2020-11-19 18:38:27 +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
Evgeny Lazarev
0a9d883d78 Fix for Reduce extractors and normalizer (#3136)
* Fixed extractor for ONNX ReduceXXX operations and fixed ReduceAxisNormalizer transformation

* Unit test for ReduceAxisNormalizer transformation
2020-11-16 18:50:13 +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
Yegor Kruglov
302ded7bd6 Revert "Reshape-able SliceConverter (#2954)" (#3118)
This reverts commit b437387bd5.
2020-11-13 15:36:04 +03:00
Pavel Esir
8c89d8d733 add getting nms_threshold / iou_threshold from RetinaNet (#3075)
* added getting nms_threshold/iou_threshold from original TF RetinaNet model

* iou_threshold definition added

* fixed getting iou_threshold for TF NMS V2, some minor corrections

* added box_encoding to NMS extractors
2020-11-12 15:04:07 +03:00
Evgeny Lazarev
f4d399f471 Fixed transformations looking for FusedBatchNorm operation to look for FBNV2 and FBNV3 also (#3078)
* Fixed transformations looking for FusedBatchNorm operation to consider FusedBatchNormV2 and FusedBatchNormV3 also.

* Updated unit test for FusedBatchNormTraining

* Fixed unit test
2020-11-12 07:33:39 +03:00
Vladimir Gavrilov
e479b011f5 retinanet onnx model has Upsample error (#3052)
* Commit.

* Fixed infer function of ONNXResize11 operation.

* Small fixes.

* Written unit tests for shape calculation for ONNXResize11.
2020-11-11 17:31:00 +03:00
Evgeny Lazarev
f633f0035c Added support for a new version of the TF OD API pre-processing part (#3063)
* Added support for a new version of the TF OD API pre-processing part of the mode

* Get rid of legacy API usage

* Fix comment and added assert

* Wording
2020-11-11 11:53:10 +03:00
Yegor Kruglov
b437387bd5 Reshape-able SliceConverter (#2954)
* initial commit

* add cast

* data type fix

* added tests

* added test without axes and steps

* remove redundant imports

* discussions resolving

* Add cast to TFSliceToSlice

* layer tests fix

* update unittest
2020-11-10 17:51:59 +03:00
Roman Kazantsev
e3b879ad3b Provide GatherND with original layout for inputs and output (#3002)
* Provide GatherND with original layout for inputs and output

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

* Fix code review #1

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2020-11-10 17:24:04 +03:00