Open Shashank-Holla opened 4 years ago
Same issue for me.
I have got the same error. Have you guys solved it?? @ayooshkathuria @Shashank-Holla @arunm8489
is this an issue with using latest version of pytorch?
is this an issue with using latest version of pytorch?
it is not as I have ran with pytorch 4.0
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.
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