Questions about parsing YOLOv9-m ONNX model with dfc-studio

Hello,

I used dfc-studio trying to parsing my custom trained model based on YOLOv9-m but got the message " Graph parsing has been failed. "
Here is the download link of my custom yolov9-m onnx model.

What’s possible root cause of this issue?
Another question, it looks like there are two start nodes “Conv_0” and “Conv_0” using Netro and complex multiple end nodes. How to set the start node and end node in parsing stage for this model?

Hey @sxk0988 ,

What error are you getting in the dfc-studio ? , can you provide the log please .

Possible Root Causes for “Graph Parsing Has Failed”

The error message typically indicates that the DFC-Studio (Dataflow Compiler Studio) encountered issues parsing your YOLOv9-m ONNX model. Here are potential causes:

  1. Unsupported Operations or Layers:
    Your model may contain custom layers, unsupported activation functions, or dynamic shapes that are not compatible with Hailo’s Dataflow Compiler (DFC).

  2. Multiple Start Nodes:
    Having multiple start nodes (e.g., Conv_0 and Conv_0) can confuse the parsing tool, as it expects a single entry point.

  3. Incorrect or Complex End Nodes:
    Ambiguity in determining the output layers can arise from multiple or undefined end nodes.

Recommendations for Debugging and Resolving Parsing Issues

  1. Validate the ONNX Model:
  • Run the ONNX model through an ONNX runtime to ensure it works as expected:
import onnx
from onnxruntime import InferenceSession

model = onnx.load("best_v9m.onnx")
onnx.checker.check_model(model)

session = InferenceSession("best_v9m.onnx")
print("Model inputs:", session.get_inputs())
print("Model outputs:", session.get_outputs())
  1. Simplify the Model Graph:
  • If possible, export the model without unnecessary layers or operations that could confuse the parser.
  1. Specify Start and End Nodes:
  • Explicitly set these during the parsing stage to resolve ambiguities in complex graphs.

How to Set Start and End Nodes During Parsing

  1. Identify Start Nodes:
  • Use tools like Netron or DFC-Studio’s graph viewer to locate nodes without incoming edges.
  • Choose a single valid entry point (e.g., Conv_0) for the model’s input.
  1. Identify End Nodes:
  • Locate nodes with no outgoing edges or those producing the model’s final outputs (e.g., detection heads in YOLO models).
  • Define these nodes as the end points.
  1. Set Nodes Manually:
  • In DFC-Studio: Use the GUI to define start and end nodes.
  • In HailoCLI: Specify start and end nodes explicitly:
hailo -i best_v9m.onnx -o model.hef --start-nodes Conv_0 --end-nodes [EndNode1, EndNode2, ...]

If the model still fails to parse , please provide full log file and error trace so we can help you better !

Hello @omria ,

Sorry, I tried to get the logs but failed. The “Error Details” pop-up won’t let me copy the information. From Netron or dfc-studio, the graph show there are two start nodes. So don’t know how to put the start node in the parsing code, just put the “Conv_0” to parse this model is okay or not.