[BYOM] Why th number of classes for yolov5 is 184?

YoloV5 Number of classes incorrect:

samautoguide-project-1:

BYOM with YoloV5 trained model:
Hi!

I trained a model to recognize lettuce plants for object detetction. My wish is to use edge impulse to deply it as a open MV firmaware and a arduino nicla vision firmware. At the end of the training step I exported my moddel as .onnx file, int8 quantized.

But when I import onnx file in edge impulse, an select that it’s a yolov5 model, edge impulse don’t ask me class number but just wait 184 classes labels. I only trained my model on 2 classes.

How could I do to perform my deployment ?

Hi @samautoguide,

Can you import your .onnx model into netron.app and see what the expected output tensor shape is? Could you share your model so we can look at it?

Hi there,

I’m not familiar with netron.app schematics. That said the forum does not allow me to share .onnx files with you and loading my jpg image on the forum does not work either, in my opinion it is too heavy.

If you could advise me on the training parameters for my models, to be correct with regard to the characteristics of a nicla vision camera?

Hi @samautoguide,

It sounds like you imported a pre-trained YOLOv5 model using Edge Impulse’s “bring your own model” (BYOM) feature. If you do that, then you cannot retrain the model or change the number of output classes. You will need to retrain the model on your own data using some other system or use a custom block (see: GitHub - edgeimpulse/yolov5: YOLOv5 transfer learning model for Edge Impulse) to train a model in Edge Impulse.