andy-yun / pytorch-0.4-yolov3

Yet Another Implimentation of Pytroch 0.4.1 and YoloV3 on python3
MIT License
279 stars 72 forks source link

Revert "Fix training crash with custom batch size" #4

Closed andy-yun closed 5 years ago

andy-yun commented 6 years ago

Reverts andy-yun/pytorch-0.4-yolov3#2

Because the getitem is called in every iteration, the image augmented for every 64 images. Some cases, batch_size is 1, then all images are resized. This is not the case we expected.

mickolka commented 6 years ago

That is exactly what is expected: each new batch (in your proposed case, of size 1, but there is nothing special about this value) will contain images of different size. First 4000*64 seen images won't be resized. After that, all images are resized anyway, but the target size is changed each batch_size images.

andy-yun commented 6 years ago

In most cases, you are right because of the width and height are same and assigned to 13*32. But, I trained and tested at the different image size. for example, I use 480x800 images. In that cases, the images are not correctly trained by many resized images.

mickolka commented 6 years ago

Would be useful to see the actual code you used to discuss it further, can't really understand what you mean.