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).
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).
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
Hi @JKTan
You don't have to train model in eIQ, you can use model tool to convert your model.
Best Regards
Zhiming
Hi
Please use eIQ to quantify model
Best Regards
Zhiming