Article ID: 000092780 Content Type: Error Messages Last Reviewed: 01/11/2023

Unable to Optimize Converted Custom YOLOv5 ONNX Model into INT8 Intermediate Representation (IR)

BUILT IN - ARTICLE INTRO SECOND COMPONENT
Summary

Correct way to convert custom YOLOv5 ONNX model into IR

Description
  • Converted custom YOLOv5 ONNX model into FP32 IR:
    mo --input_model model.onnx
  • Ran Post Training Optimization Tool (POT) with the FP32 IR.
  • Received error:
    Error: AssertionError: Incorrect mapping then_graph outputs with Result_6617 outputs! Can't find port with ID 4 in If operation.
Resolution
  1. Visualize the ONNX model in Netron*.
  2. Search the keyword Transpose in Netron.
  3. Obtain the convolution node name.
  4. Specify the convolution node name when converting ONNX model into IR:
    mo --input_model model.onnx --output <conv_node_name>
  5. Run POT with IR:
    pot -c model.json

Related Products

This article applies to 1 products