hailo-ai / hailo_model_zoo

The Hailo Model Zoo includes pre-trained models and a full building and evaluation environment
MIT License
185 stars 35 forks source link

Dataflow compiler not parsing for yolov8 #87

Open xecrotron opened 3 months ago

xecrotron commented 3 months ago

There are certain issues which I was facing while working with Dataflow Compiler.

  1. Dataflow compiler is not parsing the model for yolov8 but working for yolov5 and other models. How to parse the yolov8 Ultralytics model?

I've installed Hailo Dataflow Compiler SDK. I have yolov8 model in onnx format.

I ran the command: hailo parser onnx yolov8s.onnx I've got this error which I don't understand. I'm confident that start and end nodes are correctly written.

Screenshot from 2024-04-01 12-52-09

  1. Hailo Compiler is not working in full precision on YoloV5 ultralytics. Is it necessary to work in 8 bit model? If not, how can we work with full precision.

I've ran command: hailo optimize yolov5s.har --full-precision-only

Screenshot from 2024-04-01 12-58-08

Then I ran: hailo compiler yolov5s_fp_optimized.har and got some error like this

image

Request to check on this. If someone have worked with similar issues. Please post the solution.

omerwer commented 2 months ago

Hi @xecrotron,

Regarding the yolov8 issue - basically, Hailo SW doesn't support some postprocessing operations for parsing. The yolov8 should have 6 end nodes which are the last convolution layers before the postprocess. If you tool the yolov8s model from the Hailo Model Zoo, the parsing command should be the following while in the Dataflow compiler environment: hailo parser onnx yolov8s.onnx --end-node-names /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

Regarding the yolov5 compilation issue - the Hailo compiler supports only quantized models to 4\8\16 bit. You cannot compile a full precision model. The fp optimization is adding the model optimization to the parsed model, but without applying quantization.

Regards,