Article ID: 000092161 Content Type: Error Messages Last Reviewed: 09/08/2022

Encountered Error While Directly Importing Model in Runtime with Post-training Optimization Tool (POT)

BUILT IN - ARTICLE INTRO SECOND COMPONENT
Summary

POT expects the Intermediate Representation (IR) model that was processed with offline transformations.

Description
  1. Created the IR model in runtime using serialize in runtime
  2. Ran into the following error when directly importing the IR model with POT in runtime

    assert len(node.in_nodes()) == 2, 'The Squeeze node {} must have 2 inputs'.format(node_name)
    AssertionError: The Squeeze node Squeeze_1034 must have 2 inputs

Resolution

Direct import in runtime does not apply offline transformations to the model while POT expects the IR to be processed by offline transformations.

Apply offline transformations:

from openvino.offline_transformations import apply_moc_transformations
apply_moc_transformations(net_onnx, False)

Related Products

This article applies to 1 products