pytorch-yolo-v3 icon indicating copy to clipboard operation
pytorch-yolo-v3 copied to clipboard

grid calculation for the 3rd prediction layer in

Open Shashank-Holla opened this issue 4 years ago • 5 comments

https://github.com/ayooshkathuria/pytorch-yolo-v3/blob/fbb4ef98d5a598f4c8eded6d618a599b7d289e2f/util.py#L27

grid_size calculation in the predict_transform function. For the stride and grid_size for 3rd prediction layer, the inp_dim is 608 and prediction.size(2) is 52. With floor division, stride is calculated as 11 (608 // 52) and grid_size is calculated as 55 (608 // 11). But the desired grid_size for the 3rd prediction layer is 52. With grid_size as 55, prediction reshape is failing with below error- RuntimeError: shape '[1, 255, 3025]' is invalid for input of size 689520

Shashank-Holla avatar Mar 26 '20 15:03 Shashank-Holla

Same issue for me.

arunm8489 avatar Apr 09 '20 14:04 arunm8489

I have got the same error. Have you guys solved it?? @ayooshkathuria @Shashank-Holla @arunm8489

ashishgupta2598 avatar May 26 '20 21:05 ashishgupta2598

is this an issue with using latest version of pytorch?

MaxwellHogan avatar Oct 01 '20 09:10 MaxwellHogan

is this an issue with using latest version of pytorch?

it is not as I have ran with pytorch 4.0

MaxwellHogan avatar Oct 01 '20 09:10 MaxwellHogan

I found the 608 number that doesn't divide by 52 comes from the first block in the yolo.cfg; "net". If you change the width and height values there to 624 it all works.

nickblock avatar Oct 18 '20 20:10 nickblock