Unable to Run Yolov8 on i.MX8MPlus EVK

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unable to Run Yolov8 on i.MX8MPlus EVK

546 Views
JKTan
Contributor I

Hi,

Following the guide in eIQ Model Zoo github, eiq-model-zoo/tasks/vision/object-detection/yolov8 at main · NXP/eiq-model-zoo · GitHub I am unable to deploy Yolov8 onto i.MX8MPlus EVK.

What I had done (following the README guide exactly):

 Machine Ubuntu 20.04

$ git clone https://github.com/DeGirum/ultralytics_yolov8 && cd ultralytics_yolov8
$ pip install ultralytics
$ python dg_export.py --weights yolov8n.pt --format tflite --imgsz 640
## Transfer 'yolov8n_full_integer_quant.tflite' to EVK

i.MX8MPlus Linux

$ pip3 install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org ultralytics
$ yolo export model=yolov8n.pt imgsz=640 format=tflite int8
Error: Illegal instruction (core dumped)

 

To work around it, I adapted the example script from Yolov8 ultralytics/examples/YOLOv8-OpenCV-int8-tflite-Python/main.py at main · ultralytics/ultralytics · Gi... which uses tflite_runtime library. However, it was clear to me that this yolov8 script is outdated.


Reason: Using eIQ Toolkit, the yolov8n_full_integer_quant.tflite has 6 outputs. The scores output has the shape (1, <number>, 80) while the bounding box output has the shape (1, <number>, 64). 

JKTan_0-1724134918714.png

The script from Yolov8 github only utilizes output_details[0] (code line 273 to 275) to extract both the bounding box indices information and scores information (code line 203 and 208), which is wrong.

 

Please assist. What I am looking for is a python script to run Yolov8 model (yolov8n_full_integer_quant.tflite) on i.MX8MPlus (using tflite_runtime library, not ultralytics). 

Tags (1)
0 Kudos
Reply
3 Replies

446 Views
JKTan
Contributor I

Hi Zhiming,

 

Can you outline what should I do to quantify the model using eIQ? If you are referring to training and quantization of the Yolo model via eIQ Toolkit, I am facing a new error on it. Unable to Train Model on own datasets via eIQ Toolkit - NXP Community

 

Regards

JK

0 Kudos
Reply

433 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @JKTan 

You don't have to train model in eIQ, you can use model tool to convert your model.

Best Regards
Zhiming

0 Kudos
Reply

507 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi

Please use eIQ to quantify model

Best Regards
Zhiming

0 Kudos
Reply