From 499554e68c5a4d9691e9973fee80a3190f538f22 Mon Sep 17 00:00:00 2001 From: tomdol Date: Mon, 18 Oct 2021 17:22:39 +0200 Subject: [PATCH] POT adaptation to the new API --- tools/pot/openvino/tools/pot/graph/graph_utils.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/pot/openvino/tools/pot/graph/graph_utils.py b/tools/pot/openvino/tools/pot/graph/graph_utils.py index 86d9473b943..00faa41fc0b 100644 --- a/tools/pot/openvino/tools/pot/graph/graph_utils.py +++ b/tools/pot/openvino/tools/pot/graph/graph_utils.py @@ -7,14 +7,14 @@ from copy import deepcopy from mo.graph.graph import Graph from mo.utils.ir_reader.restore_graph import restore_graph_from_ir, save_restored_graph from mo.utils.logger import init_logger -from openvino.inference_engine import IECore # pylint: disable=E0611 -from openvino.offline_transformations import ApplyPOTTransformations # pylint: disable=import-error,no-name-in-module +from openvino import Core +from openvino.offline_transformations import apply_pot_transformations # pylint: disable=import-error,no-name-in-module from ..graph.passes import ModelPreprocessor from ..utils.logger import stdout_redirect init_logger('ERROR', False) -ie = IECore() +core = Core() def load_graph(model_config, target_device='ANY'): @@ -28,8 +28,8 @@ def load_graph(model_config, target_device='ANY'): xml_path = model_config.model if target_device in special_transform_devices: - network = ie.read_network(model=xml_path, weights=bin_path) - ApplyPOTTransformations(network, target_device.encode('utf-8')) + network = core.read_network(model=xml_path, weights=bin_path) + apply_pot_transformations(network.get_function(), target_device.encode('utf-8')) bin_path = serialized_bin_path xml_path = serialized_xml_path network.serialize(xml_path, bin_path)