Qengineering / YoloV8-ncnn-Raspberry-Pi-4

YoloV8 for a bare Raspberry Pi 4 or 5
https://qengineering.eu/deep-learning-examples-on-raspberry-32-64-os.html
BSD 3-Clause "New" or "Revised" License
108 stars 7 forks source link

Problem when creating a model.bin and model.param #10

Open LorenzoCatarsi opened 6 months ago

LorenzoCatarsi commented 6 months ago

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

model=YOLO('yolov8n.pt')

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

- Converting from onnx to ncnn
```python
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

Qengineering commented 6 months ago

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

LorenzoCatarsi commented 6 months ago

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

Qengineering commented 6 months ago

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