Guide step-by-step how to compile custom models to HEF

Hi,
I’m starting to play with the AI Hat+ .
I found it challenging to convert my custom model to HEF. Thus, I wrote a minimum step list to perform this conversion using Docker:

or without Docker:

I’ve been using these tutorials since then to convert my models, but since I’m just a beginner with Hailo consider find glitches.

I’d appreciate it if someone could review and contribute with fixes.

Regards,
doleron

4 Likes

[warning] Running model optimization with zero level of optimization is not recommended for production use and might lead to suboptimal accuracy results I am getting this warning can you help me out with this, even tough it says warning i am able to get the hef file at the end

Hey @Karthik_Senthilkumar,

Welcome to the Hailo Community!

Yes, it will output the HEF file, but the issue is that it’s not optimized, so you’ll get lower FPS. Because of that, it might not meet your expectations or requirements - that’s basically what the error message is telling you.

Thanks for the info, I am actually going to mount this in a drone to detect people using my custom YOLOv8 model so for that I actually need the best performance it can give, so could you please tell me how to do that, and i am also a beginner in it, I am currently using a non docker type for the compilation from onnx to hef

I suppose you are getting this issue because of one or both reasons:

  • You are not compiling using the GPU
  • You are using less than 1024 images in your calibration set

How can I make use of my GPU, in the neofetch command it shows my GPU as recognised

Hi Karthik,

thank you for point it out. Indeed, my tutorial has an error that prevents hailomz from using the GPU. It turns out that hailomz does not support CUDA 12.4. Thus, change the Dockerfile from:

# using a CUDA supported Ubuntu 22.04 image as base
FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04 AS base_cuda

to:

# using a CUDA supported Ubuntu 22.04 image as base
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 AS base_cuda

Best, Luiz