Commit Graph

43 Commits

Author SHA1 Message Date
Anastasiia Pnevskaia 4f3474abf6
[TF FE] Set single input tensor names in TF1 formats. (#22503)
Description: 
Change setting of names in TF1 to make single input tensor.

Ticket: 129457


Code:
* [x]  Comments
* [x]  Code style (PEP8)
* [x]  Transformation generates reshape-able IR
* [x]  Transformation preserves original framework node names
* [x]  Transformation preserves tensor names


Validation:
* [x]  Unit tests
* [x]  Framework operation tests
* [x]  Transformation tests

Documentation:
* [x]  Supported frameworks operations list
* [x]  Guide on how to convert the **public** model
* [x]  User guide update

---------

Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>
2024-02-19 13:54:42 +00:00
Roman Kazantsev 1004227fa3
[TF FE] Report uninitialised variable in case TFVariable remains (#22772)
**Details:** Report uninitialised variable in case TFVariable remains

**Ticket:** CVS-131589

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2024-02-12 10:47:48 +00:00
Roman Kazantsev 5381522b35
[TF FE] Remove use of heavy opset header in unit-tests (#22449)
* [TF FE] Remove use of heavy opset header in unit-tests

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

* Apply suggestions from code review

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2024-01-26 17:58:50 +00:00
Roman Kazantsev b0bc95f3e0
[TF FE] Implement native support of string tensors for TensorFlow models (#22024)
* [TF FE] Implement native support of string tensors for TensorFlow models

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

* Update unit-test for model with string tensor

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

* Update graph comparator for string Constant comparison

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

* Update unit-test

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

* Add layer tests for string tensor

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

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2024-01-09 20:54:55 +01:00
Maxim Vafin 570817998d
Update reverse infer to allow changing shape if it already partially defined (#21073)
* Update reverse infer to allow changing shape if it already partially defined

* Update tests

* Remove changes in If

---------

Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>
2023-11-20 21:57:43 +00:00
Maxim Vafin d0ef28e541
Reverse infer deduce second Squeeze input (#19923)
* Reverse infer deduce second Squeeze input

* Fix build

* Fix tf tests

* Small optimization

* Fix type

* Fix tests
2023-09-21 17:37:33 +02:00
Roman Kazantsev 24ddf1b274
[TF FE] Use regular Convolution in case dynamic input channels (#19253)
* [TF FE] Use regular Convolution in case dynamic input channels

This solution is aligned with the legacy frontend but it has limitation.
This is a temporal solution until the core obtains ShapeOf evaluator.

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

* Remove unused variable from the test

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

* Fix unit-test

* Update mo unit-test

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-08-18 13:39:59 +04:00
Georgy Krivoruchko 18ab677952
[TF FE] Enabled MMAP for SavedModel and MetaGraph (#18471)
* Moved mmap to openvino/util as a shared functionality

* Enabled MMAP for SavedModel and MetaGraph

* Fixed CMake

* Fixed a lost line

* Simplified code for compilers

* Aligned with an actual master

* Enabled mmap by default and added test

* Suppressed warning, added test for MetaGraph, additional messages

---------

Co-authored-by: Andrei Kochin <andrei.kochin@intel.com>
2023-08-15 14:36:08 +00:00
Oleg Pipikin b211767280
Consolidate common test utils targets (#18385)
* Consolidate test util targets

* Fix code style

* Fix 1

* Fix code style
2023-07-17 11:59:13 +00:00
Roman Kazantsev 826f345daf
[TF FE] Support TF1 Control Flow: Switch, Merge (#18378)
* [TF FE] Support Switch and Merge to fuse into If operation

It introduces support of TF1 control flow with Switch and Merge nodes.

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

* Add script for test model generation

* Fix code-style

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

* Fix build issue

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

* Fix build issue with types

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

* Apply code-review feedback: optimizations in utils

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

* Fix build issue

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

* Apply code-review remarks and cover more cases

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

* Remove commented code

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

* Remove unused vars

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

* Update MO unit-tests wit Switch-Merge case

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

* Fix build issue: remove unused variable

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

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-07-14 15:56:34 +02:00
Roman Kazantsev 5482e85082
[TF FE] Handle control dependencies to have correct outputs (#18175)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-06-22 12:46:11 +04:00
Georgy Krivoruchko ee659c1ce8
[TF FE] Workaround for Broadcast/Concat issue with empty tensors (#17864)
* Added transformation for Concat

* Added test

* CI fix

* Fixed behavior of the "empty tensor list" test
2023-06-07 14:17:20 +04:00
Evgenya Stepyreva 5e299c1949
Make pre-commit green again (#17727)
* Make pre-commit green again

* Minimize impact
2023-05-25 14:01:22 +04:00
Roman Kazantsev 3925abfb19
[TF FE] Avoid usage of NGraph routines (#17709)
* [TF FE] Avoid usage of NGraph routines

Also, it introduces separate test fixture with graph comparison
for FEs

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

* Specify tickets for TODOs

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-05-24 19:42:41 +02:00
Roman Kazantsev b253342ea6
[TF FE] Use original input types for SavedModel (#17295)
Also, refactor TF FE unit-tests

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-05-01 15:46:29 +04:00
Georgy Krivoruchko 835f51a5d2
[TF FE] Added additional pruned inputs for MetaGraph support (#17237)
* Added handling of additional pruned inputs
Added possible topology of RestoreV2 -> AssignVariableOp
Added additional checks

* Extended tests coverage
2023-04-28 13:03:33 +04:00
Roman Kazantsev 7cf9d109e8
[TF FE] Implement optimal conversion of body graphs (#17211)
* [TF FE] Implement optimal conversion of body graphs

Preliminary setting input shapes and types for body graph InputModel
provides more optimal conversion of body-graphs.

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

* Fix build issue

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-04-26 12:12:54 +04:00
Georgy Krivoruchko 3f07c8b48b
[TF FE] Added MetaGraph file format (#16524)
* Separeted SavedModelVariablesIndex class from Saved Model

* Renamed SavedModelVariablesIndex class

* Enabled Tensorflow MetaGraph

* Enabled Tensorflow MetaGraph

* Covered VariableV2 and Assign nodes

* Applied review comments

* Added tests

* Added names to input/output ports too

* Fixed naming for using with MO

* Applied part of review comments

* Renamed meta.cpp and saved_model.cpp

* Applied shared_ptr for memory management of PtrNode

* Fixing CI

* Prevent cycles while passing thru graph

* Released requirement for Checkpointable Object Graph

* Changed naming approach to align port order

* Changed renaming order (before reordering)

* Added a Placeholder translator which checks updated shape

* WA missing Identity name

* Fix CI and restored lost translators after rebase

* WA for output names

* Removing unused params after cutting a model

* Prevents crash in case VariableV2 appears in freezed model

* Fixed saved model in case no variables.index found, but
variables exists

* Changed approach for handling native formats support

* Aligned behavior with freezing .meta files

* Fixed behavior for cutting a model by input tensor

* Applied review comments
2023-04-25 13:46:06 +04:00
Roman Kazantsev 9e89b6c5f6
[TF FE] Support NonMaxSuppression with named outputs (#16835)
* [TF FE] Support NonMaxSuppression with named outputs

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

* Simplify the test for NMS named outputs

* Share a script for test model generation

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-04-11 19:14:59 +02:00
Roman Kazantsev f991f92f8c
[TF FE] Test ResourceGather operation and fix debug caps (#16819)
* [TF FE] Test ResourceGather operation and fix debug caps

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

* Fix test generation script

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-04-11 11:33:32 +04:00
Ivan Tikhonov 72952bdc45
Disable ConstantFolding for ShapeOf subgraph in TS transformation (#16765)
* Disable ConstantFolding for ShapeOf expressions in TS transformation

* update ModelWithEmptyTensorListAndPushBack: add ShapeOf subgraph
2023-04-07 14:50:59 +04:00
Maxim Vafin 8b7e6878e8
[TF FE] Better support for named ports in tensorflow frontend (#16697)
* Fix in create_same_type_const_scalar; accurate updating type for parameter when inlining function call body

* Added Unique to the list of operations with named output ports (another MUSE fix)

* Draft: working version of extension with named ports in TF

* Merge fixes

* Refactor and productize POC

* Clean up

* Fix build

* Fix code style

* Fix lib so extension test

* Fix namespaces

* Remove usage of Any from CreatorFunction

* Fix build

* Fix arm build

* Apply review feedback

* Fix build after merge

* Apply suggestions from code review

---------

Co-authored-by: Sergey Lyalin <sergey.lyalin@intel.com>
2023-04-07 14:16:23 +04:00
Roman Kazantsev 35e03d33bb
[TF FE] Support frozen models in text protobuf format aka pbtxt (#16604)
* [TF FE] Support frozen models in Text Protobuf format aka pbtxt

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

* Fix gen_wrapper.py for pbtxt

* Fix is_supported method

* Fix gen_wrapper.py script

* Adopt test_text_frozen_format unit-test

* Update src/frontends/tensorflow/src/frontend.cpp

* Update src/frontends/tensorflow/src/frontend.cpp

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-29 11:58:08 +04:00
Roman Kazantsev 3f4b1e8205
[TF FE] Post leftovers to support the MUSE model in SavedModel format (#16520)
* [TF FE] Post leftovers to support the MUSE model in SavedModel format

It contains tests imitating a case with Tokenizer extension and raised problems:
setting custom type for body graph Parameter, named ports for RaggedTensorToSparse
and Unique operations.

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

* Update src/frontends/tensorflow/tests/convert_tricky_models.cpp

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-24 11:07:56 +04:00
Roman Kazantsev aaa4a4c210
[TF FE] Skip Assert operation and add test (#16484)
At the conversion stage we can't resolve Assert node because the condition
is computed only during inference time.

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-23 11:49:46 +04:00
Ivan Tikhonov 8da01d4c2d
TransposeSinking transformation: support new ops and fix performance issues (#15660)
* Resolve the performance issues in TransposeSinking transformation

* codestyle

* fix warning as error, fix tests failures

* fix ts for Concat and Reduce

* Fix TransposeReduceBackward

* fix the issue in TransposeFuse transformation

* fix TransposeReduce transformations

* Fix TransposeReduction, fix TransposeSinkingSplit, add unsqueeze support

* delete debug print

* Add additional validations

* fix node validation

* Fix validate for split, revert changes for concat, add BatchToSpace/SpaceToBatch

* Add SpaceToBatch/BatchToSpace

* fix TS for Interpolate + codestyle

* fix gna build

* Support TS for Interpolate, VariadicSplit, IsInf, IsNan, IsFinite + refactoring

* add the missed line

* add include

* TransposeSinking tests refactoring: part1

* TransposeSinking tests refactoring: part2

* Add limited support for StridedSlice op

* codestye

* TransposeReduction: skip the case when 2nd input for Squeeze is not provided

* Transpose sinking tests refactoring: part 3. + Revert changes in MOC.

* fix build

* codestyle

* Add tests for TS backward transformations, update TransposeSinkingFuse transformation, delete StridedSlice transformation prototype + tests refactoring

* fix unary tests

* Fix warning as error on Windows

* Add new tests for Unsqueeze/Squeeze; refactoring; remove debug code

* codestyle
2023-03-13 14:18:02 +04:00
Roman Kazantsev 32ac952e5f
[TF FE] Convert a model with Framework nodes (#16053)
* [TF FE] Convert a model with Framework nodes

Now the conversion pipeline will convert all unsupported operations to Framework nodes
It is done with a hope that sub-graphs with Framework Nodes will be cut in later stages
like auto-pruning.

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

* Fix build issue

* Fix dynamic element type for FusedBatchNorm

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

* Fix build issue

* Fix build issue

* Continue translation in case translator limitation

* Change undefined to dynamic type

* Have one more change to dynamic type

* Change undefined to dynamic in Const translator

* Expect MO to handle dynamic type

* Exclude TransposeSinking pass if model contains Framework nodes

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-12 01:42:34 +00:00
Roman Kazantsev 326aedb5f8
[TF FE] Support EmptyTensorList and TensorListPushBack operations (#16183)
* [TF FE] Support EmptyTensorList and TensorListPushBack operations

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

* Rename a script to generate the test model

* Correct test model generating script

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-09 19:06:16 +04:00
Roman Kazantsev f3e7e55968
[TF FE] Support multioutput body graph nodes (#16142)
This is a corner case because body graph nodes have named output ports.
This allows to support custom RetinaNet model.

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-03-08 17:29:42 +04:00
Roman Kazantsev 0ddca519d6
[TF FE] Fix auto-pruning for QueueDequeue operation (#15838)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-02-21 13:27:29 +01:00
Roman Kazantsev bce8b7a04c
[TF FE] Support auto-pruning for Iterator, IteratorGetNext, Queue and Lookup (#15731)
* [TF FE] Support auto-pruning for Iterator, IteratorGetNext, Queue and Lookup operations

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

* Fix build

* Fix build issue

* Fix build issue

* Fix build issue: use TF NodeContext

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

* Add hash_table translator

* Simplify code in translate session a bit and remove isolated Parameter nodes

* Update src/frontends/tensorflow/src/translate_session.cpp

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-02-17 07:34:09 +04:00
Roman Kazantsev 1be090abfa
[TF FE] Add Const to Result removing transformation (#15739)
* [TF FE] Add Const to Result removing transformation

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

* Add test model

* Optimize ConstToResultRemover

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-02-16 08:49:16 +01:00
Roman Kazantsev a350bd7e85
[TF FE] Support SaveV2 operation (#15572)
* [TF FE] Support SaveV2 operation

Also, implement transformation to remove UnsupportedConstant to Result
isolated sub-graphs

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

* Revert change for Constant

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-02-08 10:35:39 +00:00
Maxim Vafin d4cb719213
Add support for GroupConvolution in DilatedConvolutionConverter (#15168)
* Add support for GroupConvolution in DilatedConvolutionConverter

* Fix codestyle

* Update src/common/transformations/tests/common_optimizations/dilated_convolution_converter.cpp

* Update src/common/transformations/tests/common_optimizations/dilated_convolution_converter.cpp

* Add tf frontend test

* Apply codestyle

* Update src/frontends/tensorflow/tests/convert_tricky_models.cpp
2023-01-22 14:01:16 +03:00
Ilya Churaev 0c9abf43a9
Updated copyright headers (#15124)
* Updated copyright headers

* Revert "Fixed linker warnings in docs snippets on Windows (#15119)"

This reverts commit 372699ec49.
2023-01-16 11:02:17 +04:00
Roman Kazantsev a38366a707
[TF FE] Fix Wide and Deep model conversion (#14931)
* [TF FE] Fix Wide and Deep model conversion

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

* Fix build

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-01-05 17:29:39 +00:00
Roman Kazantsev f13e7e1352
[TF FE] Support If and PartitionedCall operations (#14910)
* [TF FE] Support If and PartitionedCall operations

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

* Fix build

* Fix frontend wrapper for tests

* Erase tensor names in body graph before caching

* Apply code-review feedback: recover m_op_translators in Frontend

* Rename test models

* Rename unit-tests

* Correct scripts for test model generation

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2023-01-05 15:34:15 +03:00
Roman Kazantsev 238c3234a9
[TF FE] Support body graph conversion and its injection (#14841)
* [TF FE] Support body graph conversion and injection

Now this is a base for further implementation support for StatefulPartitionedOp, While, and If operations

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

* Remove unused variable

* Remove artifacts of serialization experiment

* Apply code-review feedback: comments for decoder_argdef

* Create a mat to cache function indices by names

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2022-12-28 20:08:05 +00:00
Roman Kazantsev e09995bc60
[TF FE] Support models with topologically unsorted nodes (#14652)
* [TF FE] Support models with topologically unsorted nodes

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

* Fix conversion for models with cycle

* Fix code-style

* Fix code-style

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2022-12-16 08:50:40 +03:00
Roman Kazantsev e44a4fc6d2
[TF FE] Support Assert with string tensors (#14640)
* [TF FE] Support Assert with string tensors

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

* Update src/frontends/tensorflow/src/op/const.cpp

* Update src/frontends/tensorflow/src/op/const.cpp

* Apply code-review feedback: better to use UnsupportedConstant

* Correct unit-test

* Replace Op with Node

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2022-12-15 19:28:34 +04:00
Roman Kazantsev a945597802
[TF FE] Use _output_shapes attribute for Placeholder (#14383)
* [TF FE] Use output_shapes attribute for Placeholder

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

* Add test model

* Apply code-review feedback and remove compile warnings

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2022-12-05 23:13:53 +04:00
Roman Kazantsev 1353a23f12
Fix leftovers from PR14211 (#14238)
Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2022-11-25 20:29:23 +03:00
Roman Kazantsev db81e50a02
[TF FE] Support unknown and dynamic rank Placeholder shape (#14211)
* [TF FE] Support unknown and undefined Placeholder shape

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

* Fix mistake in the test

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
2022-11-25 09:22:42 +03:00