.onnx to .hef problem

Hi! I tried to convert my .onnx(trained by yolov5) to .hef to use my hilo8l AI HAT for my project,I have followed many guides and fixed lots of problems.In the third try ,I followed this video Raspberry Pi AI Kit - Custom YOLOV8 Object Detection #raspberrypi #ai,using same DFC(3.28.0) and modelzoo(2.12.0),even fixed the yolov5s.yaml by using netron For Hailo Software - General - Hailo Community,but when I used hailomz compile yolov5s --ckpt=cybest.onnx --hw-arch hailo8l --calib-path train/images --classes 9 --performance it will show FileNotFoundError: no alls found for requested hw_arch , so I tried the other way that Hailo suggest,using parser/optimize/compiler method Getting the error: Exception: Encountered error during parsing: ‘config_values’ - General - Hailo Community.These are the code I used

hailo parser onnx cybest.onnx
hailo optimize cybest.har --use-random-calib-set
hailo compiler cybest_optimized.har --hw-arch hailo8l

Well,it did turn my onnx to hef ,but there’s a big broblem that I cant add --classes/–calib-set-path \home\jimmy\train in these codes! It will show something like hailo: error: unrecognized arguments: --classes 9/ValueError: Couldn’t detect CalibrationDataType ,so I think the model is still failed.

pls someone help,I have stuck for days!!!

Hey @user189,

Welcome to the community!

The error you’re seeing happens because you’re trying to use Model Zoo flags with the Dataflow Compiler CLI. The hailo command doesn’t recognize --classes or --calib-path - those belong to hailomz.

Before we dive in, I’d definitely recommend updating to the latest versions of both hailomz and DFC if you haven’t already.

Hailo Model Zoo (hailomz)

This is probably what you want for your YOLOv5 workflow:

hailomz compile yolov5s \
  --ckpt=/home/jimmy/cybest.onnx \
  --yaml=/home/jimmy/yolov5s.yaml \
  --calib-path=/home/jimmy/train \
  --classes=9 \
  --hw-arch=hailo8l \
  --performance

Just make sure your YAML has nc: 9 set correctly. This one command handles everything - parsing, quantization, and compilation.

DFC

If you need more control, you can use the lower-level hailo commands, but it’s more steps:

# Step 1: Parse
hailo parser onnx cybest.onnx

# Step 2: Optimize/Quantize  
hailo optimize cybest.har --calib_data=/home/jimmy/train --data_type=npy_dir

# Step 3: Compile
hailo compiler cybest_optimized.har --hw-arch=hailo8l --output=cybest.hef

The downside is you’ll need to handle the class count configuration manually in your post-processing.

For your use case, I’d stick with the Model Zoo approach - it’s designed exactly for this kind of workflow.

Let me know if you hit any other issues!