Hello!
I am using a Hailo8l on a Raspberry PI 5.
I followed the steps mentioned here (Retrain YOLOv5 on a custom dataset), except I trained the model on Google Colab and exported it as ONNX.
I tried running the following command in the /cfg/networks folder after making changes to the yaml file:
hailomz compile --ckpt ~/Documents/hailo/modifiedyolov5s.onnx --calib-path ~/Documents/hailo/calib/ --yaml modifiedyolov5s.yaml --hw-arch hailo8l
and got the following error:
hailo_sdk_client.model_translator.exceptions.MisspellNodeError: Unable to find end node names: [‘Conv_234’, ‘Conv_218’, ‘Conv_202’], please verify and try again.
Prior to this, I was able to successfully obtain a hef file by running the following:
hailo parser onnx modifiedyolov5s.onnx --hw-arch hailo8l
hailo optimize modifiedyolov5s.har --hw-arch hailo8l --use-random-calib-set
hailo compiler modifiedyolov5s_optimized.har --hw-arch hailo8l
However when I run this HEF on the RPI5, it was not able to detect anything at all. I tried providing a calibration folder (for the hailo optimize command) but was faced with the follow:
sample_file = next(iter(glob.iglob(glob_path)))
StopIteration
I have attached a screenshot of my ONNX file below and tried putting ‘output0’ as the end node, however it does not work. Am I wrongly identifying the end nodes?
~/Documents/hailo
________________|-hailo_model_zoo
________________|- modifiedyolov5s.onnx
________________|- venv
________________|- calib
____________________|-000001.jpg
____________________|-000002.jpg
____________________|-000003.jpg
____________________|- more jpgs
Illustrated above is the structure of my directory, in the hailo directory, I ran the following command: hailo optimize modifiedyolov5s.har --hw-arch hailo8l --calib-set-path ./calib/ and it gave me “StopIteration Error”, I know that the pathing is correct, otherwise it would give me “ValueError: Couldn’t detect CalibrationDataType”.
Using random calibration set does work, however I am then faced with issue 3 whereby there are no detections in inference.
It seems you are encountering several issues with retraining and deploying your YOLOv5 model on Hailo8L. Let’s go through the potential solutions step-by-step:
1. MisspellNodeError: Unable to Find End Node Names
This error occurs when the end node names in your ONNX model do not match what the Hailo SDK expects.
Solution:
Use Netron (https://netron.app) to inspect the structure of your ONNX model.
From the screenshot you shared, it looks like the final output node is labeled output0. Try using this node name in your YAML configuration.
Confirm that the YAML file correctly matches your input and output nodes.
Test with a Pre-Trained Model:
To ensure the issue isn’t with the model itself, try running a pre-trained YOLOv5 model from the Hailo Model Zoo and confirm it performs as expected.
Next Steps
Update YAML: Use the correct node name (output0), or validate with Netron if other nodes are required.
Fix Calibration: Verify your calibration dataset or try using fewer images to test access.
Post-Processing: Ensure NMS is applied to filter detections effectively.
Let me know if these steps help resolve your issues, or if you need further assistance!
For this YAML configuration, are you referring to the yaml files located in hailo_model_zoo/hailo_model_zoo/cfg/networks? And if so, is there a particular line to include this changes?
I have checked the file permissions and they do indeed have read permissions. The files are all in JPEG format, so I doubt that is the issue as well. Using random calibration does work, however it leads to inferencing issues. I have yet to try creating a TFRecord for the calibration dataset as I deem it to be quite troublesome.
How can I generate the .hef file of the pre-trained YOLOv5 model from the HMZ? Do I simply run hailomz optimize and compile on it?
An additional question:
What is the difference between using hailo DFC and hailomz to parse, optimize and compile the models into hef? Do they go through the same processes?