Yolo - Onnx model not supported

Hello,

This is a message, I guess, for dani21s ;)

I spend the week-end training my own model, creating a dataset (with roboflow) and training a model (with ultralytics hub). I finally get a working model (I can try it with ultralytics), I trained it specifying yoloV8s and export the onnx file.
However, when try the model with gamma, I always get the error :

Since I did not had more details, I used python to get the “opset” of the yolov8s.onnx file of the help patch (which is working well), and I try to export again my model using the same opset (17). Does not work.
I tried to use “Simplify Model” option, does not work. I also tried other paramaters. I cant get rid of this error.

Any suggestion ? I’m sorry I’m new to all theses stuff…

Thanks by advance !

This is the trained model : download model

I opened the model in netron and it looks like its corrupted


I don’t usually tamper with the opset when I export the model. Try exporting it again and and checking it with netron The latest onnx runtimes should be okay (If they’re not the onnx model has exotic nodes and the runtime needs an extended opset).

Thanks Hadasi for helping,

I’m not sure how to use netron as I did not know this tool thanks !
But when I open the model, it looks exactly like the one in yolov8s.onnx file.
All the links seems to be ok but I dont know what else to check.

Just one think you can see on the scrennshot the output is 1x84x8400 for yolov8s.onnx and 1x5x8400 for my model. This seems to refer to boundingbox output parameters but saying that I dont really understand what I say… and where I can modify this parameter in utralytics.

I guess the file has been corrupted during the upload or download so here is two new links :
Download 1
Download 2

Hello @rogerlette,

it could be an issue related to YoloDotNet2.0 and Pytorch version of your model


(you can find it showing properties with netron.app).
Try to convert your model with ultralitics 8.0.20

Hello,

I’m replying lately cause I’m struggling, but I would like to say thank you all for your help.

  • I tried to use :
    ultralytics Yolov8.0.20
    Python 3.10
    Torch 2.0.1

  • This config was not working returning :

from ultralytics import YOLO
ModuleNotFoundError: No module named ‘ultralytics’

  • I found online that I should better use :
    ultralytics Yolov8.0.20
    Python 3.9
    Torch 2.0.1

  • This config was working but this version of ultralytics seems to be unable to open onnx model.

  • So I exported my model in .pt to be able to convert it

  • I now have this error, which, according to online help, seems to be linked to some mismatch versions between python, ultralytics or torch :

YOLOv8 requirement “ultralytics.nn.modules.conv” not found

So… I cant make my own model work for now in gamma. I’m still trying to find a way to convert it. If you have any idea which could help, thanks a lot.