Skip to content

Commit 4661b06

Browse files
authored
AC: fix output tensor mapping for compiled model (#3422)
1 parent a5e6bb5 commit 4661b06

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/accuracy_checker/openvino/tools/accuracy_checker/launcher/openvino_launcher.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,19 +495,24 @@ def _log_versions(self):
495495
def _create_network(self, input_shapes=None):
496496
model_path = Path(self._model)
497497
compiled_model = model_path.suffix == '.blob'
498+
self.out_tensor_name_to_node = {}
498499
if compiled_model:
499500
self.network = None
500501
with open(str(self._model), 'rb') as f: #pylint:disable=unspecified-encoding
501502
self.exec_network = self.ie_core.import_model(io.BytesIO(f.read()), self._device)
502503
self.original_outputs = self.exec_network.outputs
503504
model_batch = self._get_model_batch_size()
504505
self._batch = model_batch if model_batch is not None else 1
506+
for out in self.original_outputs:
507+
if not out.names:
508+
continue
509+
for name in out.names:
510+
self.out_tensor_name_to_node[name] = out.get_node().friendly_name
505511
return
506512
if self._weights is None and self._model.suffix != '.onnx':
507513
self._weights = model_path.parent / (model_path.name.split(model_path.suffix)[0] + '.bin')
508514
self.network = self.read_network(self._model, self._weights)
509515
self.original_outputs = self.network.outputs
510-
self.out_tensor_name_to_node = {}
511516
for out in self.original_outputs:
512517
if not out.names:
513518
continue

0 commit comments

Comments
 (0)