Commit Graph

144 Commits

Author SHA1 Message Date
Evgenya Stepyreva
cd391389ce [ MO ] Complete weights layout permutation (#2299)
* MO TF: FQPerChannel extractor

* [ MO ] Complete weights layout permutation

* removed deleted file out of BOM

* Bring back stashed changes

* Skip if no weights permutation

* Conditional permutation

* Comments
2020-09-18 14:42:16 +03:00
Svetlana Dolinina
cdedc4af19 added check to avoid IR generation in case of wrong input shape (#2127)
* added check to avoid IR generation in case of wrong input shape

* review changes
2020-09-16 11:29:05 +03:00
Evgenya Stepyreva
1007b05104 [DOC] Reshape feature (#2023)
* [DOC] Reshape feature

* Comments adressed.

* Clarifications

* Converting_Model_General.md

* Update ShapeInference.md

* Update ShapeInference.md

* Comments

* Update Convert_Object_Detection_API_Models.md

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>
2020-09-11 21:41:42 +03:00
Anton Chetverikov
e6e7f5158a Fix Mish and SoftPlus value propagation functions (#2120)
* Fix Mish and SoftPlus value propagation functions

* Add unit tests for SoftPlus & Mish operations value propagation functions
2020-09-11 12:58:14 +03:00
Vladimir Gavrilov
dca30b4522 Extend MO for support of Interpolate-4 (#2026)
* Commit.

* Added opset4 version in the class Interpolate.

* Added class ONNXResize11Op to read ONNX Resize with opset version >= 11.

* Added support for Interpolate-4 into transformations TestInterpolateReshapeWA and InterpolateConcat.

* Added support for Interpolate-4 into transformation InterpolateWithConcat.

* Deleted redundant checks from the transformation UpsampleToResample.

* Reverted last changes.

* Changed ONNX Resize extractor to support for Interpolate-4.

* Added conversion of ONNXResize11Op into Interpolate-4.

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

* Small fix for formatting.

* Written tests for MO version of Interpolate-4 with shape_calculation_mode = sizes.

* Written tests for infer function of Interpolate-4.

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

* Used create_op_with_const_inputs in the transformation InterpolateSequenceToInterpolate.

* The transformation ONNXResize11ToInterpolate4 was rewritten using find_and_replace_pattern.

* Now the dictionary infers (dictionary of infer functions of Interpolate) is a class static attribute.

* Deleted unused variable.

* Restored original logic of find_and_replace_pattern method of the class InterpolateReshapeWA.

* Used create_op_with_const_inputs() in the transformation InterpolateSequenceToInterpolate for opset1 case.

* Replaced resize_name by resize.soft_get('name', resize.id).

* Small fixes.

* Added two tests for Interpolate-4 infer function.

* Fixed the transformation ONNXResize11ToInterpolateV4 for the case when ONNXResize11 operation has 3 inputs.

* Added conversion of ONNXResize11 with tf_crop_and_resize_mode to ROIPooling + ONNXResize11.

* Fixed bugs in the transformation ONNXResize11ToInterpolateV4 and in the infer function of the operation ONNXResize11.

* Small changes.

* Renamed transformation that converts ONNXResize11 into ROIPooling + ONNXResize11 and fixed BOM-file.

* Fixed tests for the transformation InterpolateSequenceToInterpolate.

* Small change.

* Now the transformation InterpolateSequenceToInterpolate preserves output layer name.

* Deleted the transformation ONNXResize11ToTFCropAndResize.
2020-09-09 16:28:52 +03:00
Roman Kazantsev
82e15a5a64 Support python 3.8 by the Model Optimizer tool in default configuration (#2078)
* Support python 3.8 by the Model Optimizer tool in default configuration

* Fix after review #1

* Fix after the second round review
2020-09-09 08:34:43 +03:00
iliya mironov
9939253fed Refactored legacy code for mean_scale_values transformations (#1936)
* Remove move_to_preproc. Not actual.

* Updated documentation
2020-09-07 10:41:47 +03:00
Maxim Vafin
6730cab192 Move FakeOutput resolving to back phase (#2033) 2020-09-07 10:20:24 +03:00
Maxim Vafin
18a49f9e7e Fix fusing Multiply node with Convolution in case group != 1 (#1882)
* Fix fusing Multiply node with Convolution in case group != 1

* Add transformation test

* Do not fuse if not possible to reshape const

* Update fuse_linear_ops.py
2020-09-04 20:32:51 +03:00
Ivan Tikhonov
2d606e35c5 Enable force shape inference in RNNSeqNormilize transformation (#2069) 2020-09-04 15:08:52 +03:00
Ivan Tikhonov
2f5a28d44f LSTMCell/Sequence v1, reference implementations and decompose transformations for LSTM/GRU/RNN Cells (#2000)
* validate_and_infer_types() implementation

* input parameter validation for LSTM, GRU and RNN

* style-check applied

* Add LSTMSequence dynamic shape validation and test props for RNNCell, GRUCell, LSTMCell and LSTMSequence.

* recurrent_sequence.hpp moved to ngraph/core/include/ngraph/op/util/

* style check applied

* removed unused variable from LSTMSequence::validate_and_infer_types

* Add missing newline mark at the end of file.

* Add supression macro for FusedOp deprecation.

* Add element type initialization

* transpose,rnn cell reference implementations

* Apply PR review remarks

* reference implementations for cells op, single layer tests, align lstm cell/sequence according to the spec

* lstm/gru/rnn cell decompostion transformations

* ngraph codestyle

* clean up

* ngraph code style

* change inheritance of Cells, fix build

* fix build

* fix build again

* remove Peepholes from LSTMSeq, fix copy_runtime_info in transformations

* Rewrite tests to use gtest exception assertions.

* resolve tests issues

* ngraph codestyle

* add missed files

* fix typeprop tests

* fix lstm sequence checks

* fix arm build

* fix arm again

* delete unnecessary file

* add convert weghts format function, enable lstm test, resolve review comments

* add ngraph builders

* ngraph codestyle

* fix unit tests

* revert transpose reference implementation

* revert LSTM Cell v0, add LSTMCell v1, update transformation lstm_cell_to_cell_ie

* v1 version of LSTMCell op

* LSTMSequence v1 operation, exclude LSTMSeq from opset4

* fix python api tests

* resolve review comments, tests for decomposition transformations, switch lstm cell to opset4 in mo

Co-authored-by: Szymon Durawa <szymon.durawa@intel.com>
2020-09-04 09:04:36 +03:00
iliya mironov
5a376477a9 Fix version print (#2022)
* Fix version print
2020-09-03 15:39:02 +03:00
Evgenya Stepyreva
16c1bbeb52 38009: InterpolateReshape fix for TensorFlow style Concat (#2047)
* 38009: InterpolateReshape fix fot TensorFlow Models

* Update interpolate_reshape_test.py

* revert debug code
2020-09-02 23:01:12 +03:00
Evgeny Lazarev
c7bcbb576c Updated ConcatOptimization to support Concat with 0D input of one dimension (#2012)
* Updated ConcatOptimization transformation to work when one dimension of input to Concat is 0D

* Fixed ConcatOptimization transformation to reconnect input edges to Concat

* Completely re-written ConcatOptimization

* Updated Concat0D optimization transformation

* Fixed order of traversing Concat input ports

* Refactored ConcatOptimization transformation to use `delete_input_port` function

* Detele trailing unconnected ports in the ConcatOptimization.py

* Cleaner implementation of ConcatOptimization + unit test
2020-09-02 10:21:23 +03:00
Pavel Esir
7cd6b353ef [MO] Fix when Crop asks for MXNet specific cmdarg enable_ssd_gluoncv (#1978) 2020-08-31 18:06:13 +03:00
Evgenya Stepyreva
510c699731 [ MO ] DepthToSpace & ShuffleChannels fusion (#2001)
* [ MO ] ShuffleChannel fusion

* DepthToSpace fusion

* test

* comment
2020-08-31 16:20:19 +03:00
Yegor Kruglov
b162f9d5ac [ MO ][ RESHAPE ] Fixes in RNNSequenceNormalize transformation (#1909)
* initial commit

* first reshap-able variant

* right version for reshape

* comment update

* fixes for failed e2e

* set data type to ngraph TensorIterator

* Fix dynamic shapes for cells ops

* clean up

Co-authored-by: yegor.kruglov <ykruglov@nnlvdp-mkaglins.inn.intel.com>
2020-08-30 01:19:22 +03:00
Roman Kazantsev
990f4e2919 Implement reshapeable CTCGreedyDecoderPlusSparseToDense transformation and test (#1906)
* Implement reshapeable CTCGreedyDecoderPlusSparseToDense transformation and test

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

* Fix consts (after code-review #1)

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

* Add CTCGreedyDecoderTransformation with more generic pattern

Also it adds new middle-replacer for transforming sequence length to a mask
along with tests.

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

* Do fixes after review #2

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

* Fix after review #3

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

* Fix after review #4

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2020-08-28 14:28:32 +03:00
Nazmul Alom
03ace8b5a6 made compatible with ubuntu 20.04 (#1798)
* made compatible with ubuntu 20.04

* demo_benchmark_app updated

* demo_security_barrier_camera updated

* demo_squeezenet_download_convert_run updated

* Update demo_benchmark_app.sh

* Update demo_security_barrier_camera.sh

* Update demo_squeezenet_download_convert_run.sh

* unwanted file removed
2020-08-27 19:40:44 +03:00
Anton Chetverikov
675e1c821e Update priorbox extenders (#1925) 2020-08-27 13:10:44 +03:00
Evgeny Lazarev
a4d90a0aba MO fusing activations (#1942)
* Added HSwish operation

* Added HSwish fusing transformation

* Fixed BOM

* Added unit test for HSwish fusing transformation

* Fixed unit tests for transformations using 'build_graph_with_edge_attrs' function to build the graph

* Added fusion transformation for Swish operation

* Added fusing transformation for Softplus operation

* Added fusion transformation for Mish operation

* Added check for the node name in the unit tests

* Fixed Mish fusion pattern

* Updated Mish fusion transformation. Added unit test

* Updated HSwish fusing transformation

* Updated Swish fusion transformation and tests

* Fixed unit tests
2020-08-27 11:56:52 +03:00
Evgenya Stepyreva
45070963a5 [MO] Relax Reshape layer hardcode under MatMul (#1921)
* [MO] Relax Reshape layer hardcode under MatMul

* Memory fix
2020-08-27 09:45:08 +03:00
Evgeny Lazarev
0e9ead3495 Added workaround for logical elementwise operations to change the constant input data type if it does not match the other one (#1955) 2020-08-27 08:46:34 +03:00
Roman Kazantsev
9d5a6cff70 Enable eager execution while TensorFlow 2 model is loaded (#1945) 2020-08-26 17:16:58 +03:00
Evgenya Stepyreva
c4920ef5a0 [ MO ] Fix for remove_op_node_with_data_node (#1934) 2020-08-25 20:30:41 +03:00
Anton Chetverikov
84c7b048db SoftPlus operation implementation (#1365) 2020-08-25 19:36:39 +03:00
Maxim Vafin
b9f698b456 Fix output name collision for incorrect ONNX models (#1930) 2020-08-25 18:43:43 +03:00
Evgeny Lazarev
aca452def8 Fixed order of transformation to convert the TF OD API SSD models (#1887)
* Fixed order of transformation to convert the TF OD API SSD models

* Refactored the sub-graph modification for the TF OD API models related to Squeeze/Reshape after SSD heads
2020-08-25 16:39:34 +03:00
Roman Kazantsev
76d2a1c351 Disable eager execution affecting TensorFlow 1 concept model handling (#1914)
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2020-08-24 18:01:45 +03:00
Evgenya Stepyreva
e6c371ae2e [ MO ] Reinfer shape sub-graphs once (#1908)
* [ MO ] Reinfer shape sub-graphs once

* feedback

* feedback
2020-08-24 14:30:41 +03:00
Ivan Tikhonov
c74643f6b6 Fix Assign, Matmul ops for correct work with keep_shape_ops feature for Kaldi models (#1885)
* fix assign and matmul ops

* fix unit test

* static shapes by default for kaldi
2020-08-24 14:11:01 +03:00
Evgenya Stepyreva
80e09dfa3b [ MO ] Change layout of Shape sub-graphs once (#1875)
* [ MO ] Change layout of Shape sub-graphs once
2020-08-21 16:27:02 +03:00
Evgeny Lazarev
94bfff2011 ONNX ScatterND MO support (#1813)
* Added extractor for ONNX operation ScatterNDUpdate

* Updated list of supported operations for ONNX
2020-08-20 13:57:22 +03:00
Evgenya Stepyreva
920bf23718 [ MO ] FloorDiv replacement (#1860)
* [ MO ] FloorDiv replacement

* BOM file

* Review comments

* FloorDiv in SupportedFrameworkList.md
2020-08-20 12:33:44 +03:00
Evgenya Stepyreva
802d605bff [ MO ] KSO ON by default (#1730)
* [ MO ] KSO ON by default.
Introduce static_shape MO key, remove keep_shape_ops key usages

* keep_shape_ops -> static_shape

* static_shape = False by default

* Fix Proposal-4 shape infer

* style-apply

* Fix Layout Change for ShapeOf paths
2020-08-20 12:06:45 +03:00
Evgeny Lazarev
8a6b3b6d89 Restore change of i64 parameters to i32 (#1866) 2020-08-19 20:18:04 +03:00
Evgeny Lazarev
ff7f4c61f3 Removed MO conversion of i64 inputs to i32 (#1835) 2020-08-19 13:58:57 +03:00
Anton Chetverikov
4925485c14 ExtractImagePatches MO implementation and nGraph transformation (#739) 2020-08-19 13:23:41 +03:00
Yegor Kruglov
b3e7cc55a6 [ MO ] Random Uniform Replacer (#1814) 2020-08-19 12:32:16 +03:00
Maxim Vafin
6b04eca3c2 Add Range-4 support (#1552)
* Add Range-4 support

* Add type infer and IR Reader extender

* Implement ngraph Range-4

* Implement evaluate for Range-4

* Remove not needed types

* Resolve review feedback

* Add RTTI defines
2020-08-19 07:58:41 +03:00
Gleb Kazantaev
8c5262f864 Convert Pad to GroupConvolution transformation (#1826)
* Added ConvertPadToConvolution pass

* Removed NasNet transformation from MO

* Renamed Conv to GroupConv; Added tests

* Fixed typo; Added RTTI
2020-08-18 17:40:45 +03:00
Roman Kazantsev
753150642e Extend MO for operation CTCLoss and partly refactor CTCGreedyDecoder (#588)
* Extend MO for operation CTCLoss

* Change sequence length format to a mask format

* Add fixes after first-round review

* Add fixes after the second-round review

* Fixing CTCLossPlusCTCGreedyDecoder transformation
2020-08-17 19:19:59 +03:00
Evgeny Lazarev
125a462400 Enable ReduceL1 and ReduceL2 operations (#1799)
* Initial version of ReduceL1, ReduceL2 and ReduceLp enabling in the MO

* Added operations ReduceL1 and ReduceL2 to nGraph

* Removed ReduceLp. Added ReduceL1 and ReduceL2

* Separated specification of ReduceLp into ReduceL1 and ReduceL2

* Updated ReduceL1 and ReduceL2 specification

* Fixed ReduceL1 and ReduceL2 type prop tests

* Implemented nGraph transformation to decompose ReduceL1 and ReduceL2. Disabled them for CPU and GPU plugins

* Updated supported framework layers

* Added unit tests for ReduceL1 and ReduceL2 reference implementation

* Fixed ReduceXXX operations reference implementation by adding support for a new parameter 'keep_dims'

* Fixed constant folding for v0::Any

* Added ReduceL1 and ReduceL2 to Python API

* Implemented ReduceL1 and ReduceL2 decomposition tests and fixed ReduceL2 decomposition

* Added specific creator for ReduceXXX operations instead of NodeBuilders

* Fixed conversion ReduceXXX to CNNLayer

* Fixed parser for ReduceLogicalXXX operations
2020-08-17 16:32:53 +03:00
Maxim Vafin
d52bfb5149 Fix problem with renaming outputs from network (#1546) 2020-08-17 14:38:41 +03:00
Pavel Esir
4302e2c120 add preliminary support of Proposal-4 in nGraph (#1448)
renamed logits -> bbox_deltas

updated ngraph unittests for Proposal

removed validate_and_infer_types Proposal-4

removed validate_and_infer_types Proposal-4

changed validate_and_infer_types in parent class of Proposal

removed get_output_size

successfully inferred Proposal on SSH and Faster-RCNN

added unittests for Proposal-4

added unittests for Proposal-4

added unittests for Proposal-4

returned back default namespace for Proposal

reduced number of outputs in v0::Proposal

correct conversion of Proposal-4 -> propodal_ie with 2 outputs

removed creator for proposal v0

removed converter for proposal v0

added Proposal-4 to MO

removed `for_deformable` attribute

added Proposal-4 to MO and nGraph Python API

removed typo in Proposal-4 specification

style corrections

style corrections and removed some redundant code

rename proposal Python api test

removed 'attrs' context from visitor

returned back AttrVisitor to check if passes OpenVINO ONNX pipeline

Should pass OpenVINO ONNX pipeline (returned back AttrVisitor just to check)

python api for Proposal-4 works ok

(style correction) python api for Proposal-4 works ok

parametrized proposal_ie some other corrections

removed 'attrs.' context from nGraph Python API tests for Proposal

minor corrections in replacer proposal->proposal_ie

corrected Python API OpenVINO-ONNX tests should pass

Improved workaround for AttributeVisitor for Proposal

Add additional check of im_info tensor shape to Proposal node in MKLDNNPlugin

😠 removed 4 extra spaces from test_dyn_attributes.py to match The Style

added new nGraph RTTI declarations, removed throwing exception in transformation

added new nGraph RTTI declarations, removed throwing exception in transformation, corrected exception in MKLDNNplugin

corrected im_info size checking in Proposal node of MKLDNNPlugin
2020-08-16 15:49:49 +03:00
Evgeny Lazarev
133baf23ef Updated a link to MO FAQ (#1750) 2020-08-13 13:20:29 +03:00
Roman Kazantsev
2ccd9b0bc8 Add requirements_tf2.txt to package_BOM.txt (#1728) 2020-08-12 08:55:56 +03:00
Evgenya Stepyreva
9c1f479a61 [ MO ] Turning GNMT KSO OFF (#1718) 2020-08-11 18:47:27 +03:00
Roman Kazantsev
b4b03b14f7 Separate MO configuration for TensorFlow 2 model conversion (#1685)
* Separate MO configuration for TensorFlow 2 model conversion

Also, it updates documentation including steps to convert
TF2 model with a custom layer in Keras H5 format into SavedModel

* Do fixes based on the first-round code review
2020-08-11 18:02:05 +03:00
Evgenya Stepyreva
2d2a6dbfd8 [ MO ] Fixed layout interpretation for 4/5D tensors calculated from ShapeOfs (#1634) 2020-08-11 09:34:04 +03:00