yolov5-net icon indicating copy to clipboard operation
yolov5-net copied to clipboard

Exception if image size is not 640x640

Open sstainba opened this issue 3 years ago • 2 comments

Inherited from the YoloModel base class per instructions, but images are 1280x1024. Set this as the value for the height/width on the new class but this causes an exception to be thrown when attempting to predict the objects.

sstainba avatar Jul 31 '22 20:07 sstainba

Inherited from the YoloModel base class per instructions, but images are 1280x1024. Set this as the value for the height/width on the new class but this causes an exception to be thrown when attempting to predict the objects.

"640x640" don't for input images but it's size that you trained your model for: !python train.py --img 640 --batch 16 --epochs 3000 --data data.yaml --cfg ./models/customModel.yaml --weights '' --cache

"--img 640"=you need 640x640 (this is size that your model is trained and your input images will be resized to that size)

Red007Master avatar Aug 18 '22 23:08 Red007Master

The model was trained with 1280x1024. The problem was the model export, actually. I didn't realize the export script needed the same size arguments to set the correct input size. I re-exported the model and it worked fine after that.

sstainba avatar Aug 19 '22 01:08 sstainba