Hello, I’m new to this, so I’d like to ask a few questions. I have a special dataset that I trained with YoloV8. How can I integrate the custom.pt weight file into raspberrypi 5 hailo8l (raspberrypi ai kit)? Can you help me with the process order (Summary: How can I run the specially trained Yolo.pt file with hilo8l)
Hey @edanaz.abdullahoglu,
Welcome to the Hailo community!
To run a custom model like YOLOv8, you’ll need to compile it using our Data Flow Compiler (DFC). I’m excited to share that the DFC will be released to the public soon. Along with the release, we’ll be publishing comprehensive guides on how to use it effectively.
Stay tuned for these upcoming resources. We’re looking forward to seeing what you’ll create with Hailo technology!
Hope this answers your question. Let us know if you need any further information!
Is there any other way, i have to deploy a custom yolov8 model on a bot and i am using raspberrypi5 + hailo8l. Please help me out its urgent.
I was able to convert my custom YOLOv8 model to ONNX and then to HEF using the model zoo.
Register on Hailos website and download the AI software suite for Linux.
Convert your model to ONNX using the ultralytics library.
Start up a Ubuntu AWS ec2 server on a instance type that has sufficent RAM (32 gb) and install the wheel on there. Upload your ONNX file to the server.
Enter the virtual environment per Hailo’s instructions and use the hailomz command to convert your model to HEF.
Thats obviously a condensed version of the steps but should put you on the right track and all of this information is available on this website and github
I followed up to that point, but I don’t know how to write the code for the HEF model and use the Hailo to accelerate the detection. I need to draw bounding boxes and access detection data as I’m writing the logic for the robot to react according to the detection. If you could help me out, it would mean a lot and be very helpful.
Do you have more detail working flow or documents?
We have the same question.
To see examples of running the model you can check the examples in here : GitHub - hailo-ai/Hailo-Application-Code-Examples
Keep in mind the python API is not yet supported on RPI and will be released soon.
The C++ examples work.
As for the DFC and Model Zoo usage , We will release a guide today here in the community on how to use them .
But please make sure to read the guideline of the DFC in : https://hailo.ai/developer-zone/documentation/
Hello, I’m trying to make and yolov8 model (custon trainned) to be converted to .hef to be used on raspberry pi but I’m getting errors and the documentation is lacking on explanation on running the hailomz compile command expecialy with the yaml files and the calibration images
Hey @gustavo
Welcome to the Hailo Community!
Can you post a new topic with the errors you are getting so we can help you
Thanks for the reply. Here is what I got so far:
1- Trainned a yolov8 on custon dataset (with 9 classes) and got the .pt file.
2- Converted .pt model to onnx
2- Exected the container as instructed on instalation guide (docker - hailo_ai_sw_suite_2024-07.1
3- On the hailo_ai_sw_suite container I have run the folowing (after changing the number of classes on the yaml file):
hailomz parse --hw-arch hailo8l --ckpt ./best.onnx yolov8n
hailomz optimize --hw-arch hailo8l --har ./yolov8n.har yolov8n
hailomz compile yolov8n --hw-arch hailo8l --har ./yolov8n.har
This gave me an .hef file without an error
- On the raspberry py, I have tried to use the hef file using the rpi-cam and the --post-process flag and pointing tho a json with the hef file and got this error:
pi@pi5ai:~ $ rpicam-hello -t 0 --post-process-file ~/rpicam-apps/assets/hailo_yolov8n_inference.json --lores-width 640 --lores-height 640
[115:21:12.633745674] [26557] INFO Camera camera_manager.cpp:313 libcamera v0.3.0+65-6ddd79b5
[115:21:12.642079358] [26560] INFO RPI pisp.cpp:695 libpisp version v1.0.6 b567f0455680 17-06-2024 (10:20:00)
[115:21:12.659006005] [26560] INFO RPI pisp.cpp:1154 Registered camera /base/axi/pcie@120000/rp1/i2c@88000/imx708@1a to CFE device /dev/media0 and ISP device /dev/media2 using PiSP variant BCM2712_C0
Preview window unavailable
No post processing stage found for "rpicam-apps"
Reading post processing stage "hailo_yolo_inference"
Reading post processing stage "object_detect_draw_cv"
[115:21:12.730851360] [26557] WARN V4L2 v4l2_pixelformat.cpp:344 Unsupported V4L2 pixel format RPBP
[115:21:12.730982267] [26557] WARN V4L2 v4l2_pixelformat.cpp:344 Unsupported V4L2 pixel format RPBP
Mode selection for 2304:1296:12:P
SRGGB10_CSI2P,1536x864/0 - Score: 3400
SRGGB10_CSI2P,2304x1296/0 - Score: 1000
SRGGB10_CSI2P,4608x2592/0 - Score: 1900
Stream configuration adjusted
[115:21:12.731302898] [26557] INFO Camera camera.cpp:1183 configuring streams: (0) 2304x1296-YUV420 (1) 640x640-YUV420 (2) 2304x1296-BGGR_PISP_COMP1
[115:21:12.731415491] [26560] INFO RPI pisp.cpp:1450 Sensor: /base/axi/pcie@120000/rp1/i2c@88000/imx708@1a - Selected sensor format: 2304x1296-SBGGR10_1X10 - Selected CFE format: 2304x1296-PC1B
[HailoRT] [error] CHECK failed - HEF file length does not match
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INVALID_HEF(26)
[HailoRT] [error] Failed parsing HEF file
[HailoRT] [error] Failed creating HEF
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INVALID_HEF(26)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INVALID_HEF(26)
Failed to create infer model, status = 26
HailoRT not ready!
#0 (0.00 fps) exp 32680.00 ag 6.17 dg 1.31
HailoRT not ready!
#1 (30.01 fps) exp 32680.00 ag 6.17 dg 1.31
HailoRT not ready!
#2 (30.01 fps) exp 32680.00 ag 8.00 dg 1.01
HailoRT not ready!
#3 (30.01 fps) exp 32680.00 ag 8.00 dg 1.01
HailoRT not ready!
now I’m getting an error trying to generate an .hef file withe the yolo8 mediun model:
(venv) quickium@gustavo:~/hailo$ hailomz compile yolov8m --classes 9 --calib-path ./dataset/images --hw-arch hailo8l --har ./yolov8m.har
<Hailo Model Zoo INFO> Start run for network yolov8m ...
<Hailo Model Zoo INFO> Initializing the hailo8l runner...
Traceback (most recent call last):
File "/home/quickium/hailo/venv/bin/hailomz", line 8, in <module>
sys.exit(main())
File "/home/quickium/hailo/venv/lib/python3.10/site-packages/hailo_model_zoo/main.py", line 122, in main
run(args)
File "/home/quickium/hailo/venv/lib/python3.10/site-packages/hailo_model_zoo/main.py", line 111, in run
return handlers[args.command](args)
File "/home/quickium/hailo/venv/lib/python3.10/site-packages/hailo_model_zoo/main_driver.py", line 250, in compile
_ensure_optimized(runner, logger, args, network_info)
File "/home/quickium/hailo/venv/lib/python3.10/site-packages/hailo_model_zoo/main_driver.py", line 84, in _ensure_optimized
model_script = _extract_model_script_path(
File "/home/quickium/hailo/venv/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/quickium/hailo/venv/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/quickium/hailo/venv/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")
Hey @gustavo,
Great job on creating your first model! Let’s break down the issues you’re facing:
-
HEF Invalid Size Error:
- Your suite is using DFC version 3.28 and HailoRT version 4.18.
- I suspect your Raspberry Pi is running HailoRT version 4.17.
You have two options:
a) Upgrade your Raspberry Pi to HailoRT 4.18:- This is a manual process and might have some issues.
- Note: Package updates will be available later this month.
b) Use the 2024.4 suite: - Download this suite.
- Compile your model there.
- Use the resulting model on your Raspberry Pi.
-
YOLOv8m .alls File Issue:
- It seems the system can’t find the .alls file.
- Which version of the model zoo are you using?
Solution:
- Search for the file in all versions from the GitHub repository.
- Download the correct .alls file.
- When running the compilation, make sure to point to this file.
If you need any further clarification or assistance with these steps, please don’t hesitate to ask.
you to change the directory path to yolov8m.alls to here:
hailo_model_zoo/cfg/alls/generic/yolov8m.alls