I am trying to run a YOLOv10 model on the NPU of an i.MX8M Plus. After quantization/conversion of the model to best_full_integer_quant.tflite, the model contains operations using int64 typed values I observe using Netron. I get errors when the model is loaded on the device as below:
WARNING: Fallback unsupported op 48 to TfLite
ERROR: Int64 output is not supported
ERROR: Int64 input is not supported
What is the procedure to create/convert a YOLOv10 model which does not include operations on int64 typed values.
I am using the following script for export and quantization. I have tried the various combinations of true/false with optimize and simplify with the same result.
Thank you
////////////////////////////////////////////////////////////////////////////////////////////////
from ultralytics import YOLO
Load the YOLOv10 model
model = YOLO(â/home/sutter/Desktop/YoloV10-train/runs/detect/train2/weights/best.ptâ)
You can remove the postprocessing from the model and export.
from ultralytics import YOLO, ASSETS
from ultralytics.nn.modules import Detect
model = YOLO("yolov10n.pt")
for m in model.model.model.modules():
if hasattr(m, "num_batches_tracked"): del m.num_batches_tracked
model.ckpt.update(dict(model=model.model))
if "ema" in model.ckpt: del model.ckpt["ema"]
model.save("model.pt")
model = YOLO("model.pt")
Detect.postprocess = lambda s,x,y,z: x
model.export(format="tflite", int8=True)
However, you will have to manually apply the post-processing after inference:
The model seems to be running on the NPU now as I do not see the int64 error. I need to examine the output tensor now.
Your help is greatly appreciated!