YoloV8-ncnn-Raspberry-Pi-4 icon indicating copy to clipboard operation
YoloV8-ncnn-Raspberry-Pi-4 copied to clipboard

Problem when creating a model.bin and model.param

Open LorenzoCatarsi opened this issue 1 year ago • 3 comments

I've tried these two methods to get the ncnn model:

  • The python yolov8 method:
from ultralytics import YOLO
import ncnn

model=YOLO('yolov8n.pt')

model.train(data="data.yaml", epochs=100, batch=8)  
path = model.export(format="ncnn")
  • Converting from onnx to ncnn
from ultralytics import YOLO

model=YOLO('yolov8n.pt')

model.train(data="data.yaml", epochs=100, batch=8)  
path = model.export(format="onxx")

After running this code i've done the steps in this guide to obtain ncnn model https://github.com/Tencent/ncnn/wiki/use-ncnn-with-pytorch-or-onnx

None of these methods worked for me and both create a segmentation fault error when running the program. I'm asking how u have obtained the .bin and .param available in the repo because only them seem to work.
I've tried also to convert not a custom trained model but the standard yolov8nano one but it doesn't work either.
I'll be grateful if someone can explain more in depth how to rearrange the code to work with custom trained model

LorenzoCatarsi avatar May 06 '24 15:05 LorenzoCatarsi

Did you see this page? https://docs.ultralytics.com/integrations/ncnn/#deploying-exported-yolov8-ncnn-models

Qengineering avatar May 06 '24 16:05 Qengineering

Did you see this page? https://docs.ultralytics.com/integrations/ncnn/#deploying-exported-yolov8-ncnn-models

yeah and i did the same as the guide reported

LorenzoCatarsi avatar May 06 '24 17:05 LorenzoCatarsi

I've used the models from @FeiGeChuanShu see: https://github.com/FeiGeChuanShu/ncnn-android-yolov8

Qengineering avatar May 07 '24 07:05 Qengineering