How to parse model which is not supported by model zoo?

Is it possible to parse, and compile yolov8n_pose model by following Parsing Tutorial in developer zone using Dataflow Compiler v3.33.0?

model: yolov8n-pose

runner = ClientRunner(hw_arch=chosen_hw_arch)
hn, npz = runner.translate_onnx_model(
    onnx_path,
    onnx_model_name,
    start_node_names=["images"],
    end_node_names=["output0"],
    net_input_shapes={"images": [1, 3, 224, 224]},
)

above code doesn’t work although the node names are correct.

additionally, I made onnx file by below code.

import onnxruntime as ort

import onnxruntime as ort
import numpy as np

session = ort.InferenceSession("yolov8n-pose.onnx")

Welcome to the Hailo Community!

Before getting to into the details of your issue, it is important to understand that ONNX and TFLite can describe many operations that cannot run on the Hailo accelerator. These types of operations are often at the beginning and end of a network and need to be removed for the conversion process and then reimplemented on the host CPU.

For the start_node_name and end_node_names you need to select the first and last layers that can run on the Hailo device. These are not necessarily the first and last node in your ONNX. You can us a tool like Netron to review your ONNX file.

For your network I recommend you first review the conversion of the Yolov8m Pose model that is part of the Model Zoo. You can find the end_node_names for that network in the YAML file.

GitHub - Hailo Model Zoo - yolov8m_pose.yaml

As you can see the model has multiple end nodes. Your model will be similar with slightly different names.

1 Like