Help converting onnx to hef

I have a defect detection machine running on rpi5 trained using yolov5. Since the fps was not too good, i decided to upgrade the kit with the ai kit from hailo. After connecting it, i could run the provided examples with smooth fps. but since last week i have been trying to convert my best.pt to best.hef so i can use it on the ai kit. i tried this tutorial Raspberry Pi AI Kit: ONNX to HEF Conversion installed dfc ver 3.28, model zoo ver 2.12, hailort ver 4.18 as there were issues with numbpy and numba versions in the latest updates. despite doing everything as asked… i get this error (hailodfc) vi@GBP-LT228:~/hailo_model_zoo$ hailomz compile yolov8m --ckpt=/home/vi/best_simplified.onnx --hw-arch hailo8l --calib-path=train/images --classes=1
Start run for network yolov8m …
Initializing the hailo8l runner…
[info] Translation started on ONNX model yolov8m
[info] Restored ONNX model yolov8m (completion time: 00:00:00.14)
[info] Extracted ONNXRuntime meta-data for Hailo model (completion time: 00:00:00.59)
[info] NMS structure of yolov8 (or equivalent architecture) was detected.
[info] In order to use HailoRT post-processing capabilities, these end node names should be used: /model.22/cv2.0/cv2.0.2/Conv /model.22/cv3.0/cv3.0.2/Conv /model.22/cv2.1/cv2.1.2/Conv /model.22/cv3.1/cv3.1.2/Conv /model.22/cv2.2/cv2.2.2/Conv /model.22/cv3.2/cv3.2.2/Conv.
[info] Start nodes mapped from original model: ‘images’: ‘yolov8m/input_layer1’.
[info] End nodes mapped from original model: ‘/model.22/cv2.0/cv2.0.2/Conv’, ‘/model.22/cv3.0/cv3.0.2/Conv’, ‘/model.22/cv2.1/cv2.1.2/Conv’, ‘/model.22/cv3.1/cv3.1.2/Conv’, ‘/model.22/cv2.2/cv2.2.2/Conv’, ‘/model.22/cv3.2/cv3.2.2/Conv’.
[info] Translation completed on ONNX model yolov8m (completion time: 00:00:00.89)
[info] Saved HAR to: /home/vi/hailo_model_zoo/yolov8m.har
Traceback (most recent call last):
File “/home/vi/hailodfc/bin/hailomz”, line 8, in
sys.exit(main())
File “/home/vi/hailodfc/lib/python3.10/site-packages/hailo_model_zoo/main.py”, line 122, in main
run(args)
File “/home/vi/hailodfc/lib/python3.10/site-packages/hailo_model_zoo/main.py”, line 111, in run
return handlersargs.command
File “/home/vi/hailodfc/lib/python3.10/site-packages/hailo_model_zoo/main_driver.py”, line 250, in compile
_ensure_optimized(runner, logger, args, network_info)
File “/home/vi/hailodfc/lib/python3.10/site-packages/hailo_model_zoo/main_driver.py”, line 84, in _ensure_optimized
model_script = _extract_model_script_path(
File “/home/vi/hailodfc/lib/python3.10/site-packages/hailo_model_zoo/main_driver.py”, line 55, in _extract_model_script_path
else resolve_alls_path(networks_alls_script, hw_arch=hw_arch, performance=performance)
File “/home/vi/hailodfc/lib/python3.10/site-packages/hailo_model_zoo/core/main_utils.py”, line 38, in resolve_alls_path
return path_resolver.resolve_alls_path(Path(hw_arch) / Path(“base” if not performance else “performance”) / path)
File “/home/vi/hailodfc/lib/python3.10/site-packages/hailo_model_zoo/utils/path_resolver.py”, line 29, in resolve_alls_path
raise FileNotFoundError(“no alls found for requested hw_arch”)
FileNotFoundError: no alls found for requested hw_arch what do i do now?

I just compiled the yolov8m model for Hailo-8L using the Model Zoo command hailomz in the current Hailo AI Software suite Docker. It worked as expected. I would recommend to use the Docker. It ensures you have all dependencies and it is easy to upgrade to the next version.

When you add the NMS to the model the ALLS script contains a path the a JSON file. See here:

GitHub - Hailo Model Zoo - yolov8m.alls

GitHub - Hailo Model Zoo - yolov8m_nms_config.json

When you retrain the model using our retraining Docker this should work automatically. When you have your own YOLOV8m model you may need to modify these files and then add them to the hailomz call.

GitHub - Hailo Model Zoo - Training - yolov8

i was able to get the file converted to .hef as per your method, but now when i am trying to run the hef file on my pi…it is unable to detect any defects or create bounding boxes. even after converting the images i used to train in .bin, and trying to run inference, the output i get in output.csv suggests no defect detected.

Hello… I have successfully compiled a .hef model using the hailo ai sw suite and following the directions provided in this link GitHub - BetaUtopia/Hailo8l: How to Setup Raspberry Pi 5 with Hailo8l AI Kit using yolov8n on Windows (WSL2 Ubuntu). But when i run detection.py directly using the camera and command - python hailo-rpi5-examples/basic_pipelines/detection.py -i rpi, it is able to detect everything and print in terminal the frame count, Xmin, Xmax, Ymin and Ymax. But when i run the same command on my best.hef using - python hailo-rpi5-examples/basic_pipelines/detection.py -i rpi --hef best.hef --labels-json labels.json, I am able to get bounding boxes displayed on the detection app screen… but on the terminal window… it is only pronting out the frame count and nothing else… What could be causing this problem?