Yolov8.pt convert to rknn and inference result issue

Which system do you use? Android, Ubuntu, OOWOW or others?

Android

Which version of system do you use? Khadas official images, self built images, or others?

Khadas Official Android 13 image

Please describe your issue below:

Model converting has no issue
But i have issue about inference result

First I test this repo rknn_yolov5_android_apk_demo

demo works fine

so i trying to test latest version of yolo (ex yolov8 sereies)

My Convert ENV

  • GCP VM Ubuntu 22.04
  • python 3.10.13
  • rknn toolkit 1.5.2

I follow this docs

!!! i changed ultralytics/ultralytics/nn/modules/head.py
results.append(torch.cat([cls, dfl], 1).permute(0, 2, 3, 1).unsqueeze(1))
→ results.append(torch.cat([cls, dfl], 1).permute(0, 1, 2, 3))

python3 test.py # yolo model(.pt) convert to onnx

and i checked model using netron

model’s input & output is correct and data type also correct


I change output tensor shape on android demo source code

Post a console log of your issue below:

inference got no error Just Detecting result problem

@re_roy you need to follow the documentation provided with the example itself, you have taken yolov8 example with documents and code of yolov5.

Please check the example code of yolov8 and see if it matches the expected result.