YOLO_v3_tutorial_from_scratch icon indicating copy to clipboard operation
YOLO_v3_tutorial_from_scratch copied to clipboard

CFG file input dimension [advice]

Open juanmed opened this issue 6 years ago • 4 comments

Hello everyone, First thanks to @ayooshkathuria for such a nice tutorial. Second I would like to point out that the input dimensions in the current version of the yolov3.cfg file from yolo repository (the one recommended to download in the tutorial part 2) contains a height = 608, width = 608. So you might encounter an error like this at some point:

RuntimeError: shape '[1, 255, 3025]' is invalid for input of size 689520

My suggestion is to change the yolov3.cfg to height=416, width = 416 as those are the dimensions used in the tutorial, particularly in line 14. Another solution is to resize the image to height = 608 and width = 608 when reading it, in the same line. A more general solution would be to read whatever dimensions are in the yolov3.cfg file and resize the image with those dimensions.

Cheers!

juanmed avatar Apr 21 '19 03:04 juanmed

Thanks @juanmed You saved the day!

kHarshit avatar May 10 '19 15:05 kHarshit

Many thanks to @ayooshkathuria for such a detailed and brilliantly explained tutorial.

@juanmed, Really nice of you to point out the config change. Was useful to me and to many others too I guess!

SambhaviPD avatar May 15 '19 12:05 SambhaviPD

Thank to the great and selfless tutorial by @ayooshkathuria and @juanmed, you save many people like us

aimxu avatar Feb 29 '20 02:02 aimxu

https://github.com/ayooshkathuria/pytorch-yolo-v3/blob/fbb4ef98d5a598f4c8eded6d618a599b7d289e2f/cfg/yolov3.cfg#L8 with=320

https://github.com/ayooshkathuria/YOLO_v3_tutorial_from_scratch/blob/8264dfba39a866998b8936a24133f41f12bfbdb7/cfg/yolov3.cfg#L8 width=416

should width for training imgs be 320, 416 or 608? Thanks!

sisrfeng avatar Mar 29 '20 13:03 sisrfeng