Commit Graph

152 Commits

Author SHA1 Message Date
Pavel Esir
2110a29b7c [MO] [Kaldi] Add TDNN Component (#1870)
* [MO] [Kaldi] Added TDNN Component

* TdnnComponent replacer graphical comment updated

* Added SpecAugmentTimeMaskComponent

* some refactor of memoryoffset shape_infer

* moved memoryoffset splitting to the middle stage

* some corrections
- set `need_shape_inferenc`=False in split_memoryoffset
- use cycle instead of pattern in tdnn_replacer

* separated splitting of MemoryOffsets in LSTM and TDNN blocks

* set transpose_weights=True in TdnnComponent

* Corrected Supported_Frameworks_Layers

* corrected comments

* separate naming for tdnn and lstm memoryoffset splits

* corrected BOM file

* corrected generaldropout_ext.py and removed 'has_default' for tdnn_component

* corrections after PR review

* renamed LSTM -> recurrent; added setting element_size for paired nodes of tdnn_memoffset and othe minor changes

* Update split_tdnn_memoryoffset.py

* corrected partial infer with new API in elemental.py and split_tdnn_memoryoffset.py
2020-10-12 14:10:27 +03:00
Pavel Esir
9a9b231c98 [MO] Fix ONNX Clamp-11 shape infer with no min/max inputs (#2603) 2020-10-12 09:55:45 +03:00
Roman Donchenko
0e502ffb35 [MO] Fix many spelling and grammar errors (#2543) 2020-10-09 12:16:12 +03:00
Ilya Lavrenov
de1cc8af2e Shellcheck tests for bash scripts (#2532)
* Added bash scripts checks with shellcheck

* Fixed indentations

* Fixed setupvars.sh with shellcheck

* Fixed MO scripts

* Compilation with newer versions of shellcheck
2020-10-05 23:37:50 +03:00
Pavel Esir
9149d899b3 [MO] Fix: add PermuteInputs to shape broadcasting (#2419)
* fix: add PermuteInputs to shape broadcasting

* fix type declaration typo
2020-10-05 12:48:57 +03:00
Zoe Cayetano
62a33f7f4b Update get_ov_update_message.py (#2499) 2020-10-02 23:19:54 +03:00
Mikhail Ryzhov
afd7d63466 Added closing braсket (#2466) (#2479)
Fixed syntax error (b4b03b1)
2020-10-01 12:26:56 +03:00
Pavel Esir
1c97b13e9a [MO] Add explicit broadcasting mode (#2077)
* [MO] Add explicit broadcasting mode

* corrected value broadcast, added nontrivial test cases

* added negative unit-tests

* added axes normalization and permute inputs

* corrected axes normalization

* Update model-optimizer/mo/utils/broadcasting.py

Co-authored-by: Evgenya Stepyreva <evgenya.stepyreva@intel.com>
2020-09-25 13:26:47 +03:00
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