From dbe051aa79fecc5e73e3a7925cf2d3238eff76fc Mon Sep 17 00:00:00 2001 From: Anastasia Kuporosova Date: Thu, 6 Apr 2023 13:02:24 +0200 Subject: [PATCH] [POT] use serialize methid (#16768) --- tools/pot/openvino/tools/pot/graph/graph_utils.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/pot/openvino/tools/pot/graph/graph_utils.py b/tools/pot/openvino/tools/pot/graph/graph_utils.py index 8229850b0f2..5ff4bf6cc3f 100644 --- a/tools/pot/openvino/tools/pot/graph/graph_utils.py +++ b/tools/pot/openvino/tools/pot/graph/graph_utils.py @@ -8,7 +8,7 @@ from openvino.tools.mo.graph.graph import Graph from openvino.tools.mo.middle.pattern_match import for_graph_and_each_sub_graph_recursively from openvino.tools.mo.utils.ir_reader.restore_graph import restore_graph_from_ir, save_restored_graph from openvino.tools.mo.utils.logger import init_logger -from openvino.runtime import Core # pylint: disable=E0401,E0611 +from openvino.runtime import Core, serialize # pylint: disable=E0401,E0611 from openvino.runtime.passes import Manager # pylint: disable=E0401,E0611 from openvino.offline_transformations import apply_pot_transformations # pylint: disable=import-error,no-name-in-module @@ -35,9 +35,7 @@ def load_graph(model_config, target_device='ANY'): apply_pot_transformations(model, target_device.encode('utf-8')) bin_path = serialized_bin_path xml_path = serialized_xml_path - # TODO: replace by openvino.runtime.serialize - pass_manager.register_pass(pass_name="Serialize", xml_path=xml_path, bin_path=bin_path) - pass_manager.run_passes(model) + serialize(model, xml_path=xml_path, bin_path=bin_path) if not os.path.exists(xml_path): raise RuntimeError('Input model xml should link to an existing file. Please, provide a correct path.')