From 347cd0e180057d6c68d4661502c361b16359936d Mon Sep 17 00:00:00 2001 From: Anastasiia Pnevskaia Date: Thu, 2 Feb 2023 09:07:30 +0100 Subject: [PATCH] TF FE import model from memory (#15242) * Added import model from memory for TF FE using string. * Small correction. * Clang format. * Code correction. * Implemented model importing to TF FE using temporary file. * Removed wrong changes. * Added check. * Removed code duplication. * Corrected logging of cli parameters. --- tests/layer_tests/mo_python_api_tests/test_mo_convert_tf.py | 1 - tools/mo/openvino/tools/mo/convert_impl.py | 4 +++- tools/mo/openvino/tools/mo/front/tf/loader.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/layer_tests/mo_python_api_tests/test_mo_convert_tf.py b/tests/layer_tests/mo_python_api_tests/test_mo_convert_tf.py index e36886c32de..892de63d69d 100644 --- a/tests/layer_tests/mo_python_api_tests/test_mo_convert_tf.py +++ b/tests/layer_tests/mo_python_api_tests/test_mo_convert_tf.py @@ -359,7 +359,6 @@ class TestMoConvertTF(CommonMOConvertTest): @pytest.mark.nightly @pytest.mark.precommit_tf_fe @pytest.mark.precommit - @pytest.mark.xfail(reason="99426") def test_mo_import_from_memory_tf_fe(self, create_model, ie_device, precision, ir_version, temp_dir): fw_model, graph_ref, mo_params = create_model(temp_dir) diff --git a/tools/mo/openvino/tools/mo/convert_impl.py b/tools/mo/openvino/tools/mo/convert_impl.py index c5e7a528bf0..6814e665954 100644 --- a/tools/mo/openvino/tools/mo/convert_impl.py +++ b/tools/mo/openvino/tools/mo/convert_impl.py @@ -183,7 +183,6 @@ def arguments_post_parsing(argv: argparse.Namespace): elif (is_kaldi or is_onnx) and not argv.input_model: raise Error('Path to input model is required: use --input_model.') - log.debug(str(argv)) log.debug("Model Optimizer started") log.debug('Output model name would be {}{{.xml, .bin}}'.format(argv.model_name)) @@ -771,6 +770,9 @@ def parse_input_shapes(argv): def driver(argv: argparse.Namespace, non_default_params: dict): init_logger(argv.log_level.upper(), argv.silent) + # Log dictionary with non-default cli parameters where complex classes are excluded. + log.debug(str(non_default_params)) + start_time = datetime.datetime.now() graph, ngraph_function = prepare_ir(argv) diff --git a/tools/mo/openvino/tools/mo/front/tf/loader.py b/tools/mo/openvino/tools/mo/front/tf/loader.py index 447218ba0bc..6aded155a41 100644 --- a/tools/mo/openvino/tools/mo/front/tf/loader.py +++ b/tools/mo/openvino/tools/mo/front/tf/loader.py @@ -328,7 +328,8 @@ def convert_to_pb(argv: argparse.Namespace): # if this is already binary frozen format .pb, there is no need to create auxiliary binary frozen protobuf # the main thing is to differentiate this format from text frozen format and checkpoint # that can utilize input_model option - if argv.input_model and not argv.input_model_is_text and not argv.input_checkpoint: + if argv.input_model and not argv.input_model_is_text and not argv.input_checkpoint and \ + isinstance(argv.input_model, str): return None user_output_node_names_list = argv.output.split(',') if argv.output else None