"RuntimeError: The expanded size of the tensor (1200) must match the existing size (1199) at non-singleton dimension 1. Target sizes: [600, 1200, 3]. Tensor sizes: [600, 1199, 3] "
See original GitHub issueHi All, got a Runtime error while training on the Open Images dataset after around 9000 iterations in the first epoch.
File "/home/munzueta/Kaggle/ObjectDetection2019/faster-rcnn.pytorch/lib/roi_data_layer/roibatchLoader.py", line 177, in __getitem__ padding_data[:, :data_width, :] = data[0]
RuntimeError: The expanded size of the tensor (1200) must match the existing size (1199) at non-singleton dimension 1. Target sizes: [600, 1200, 3]. Tensor sizes: [600, 1199, 3]
I am not sure what might cause it, as I have not change the implementation of roibatchLoader.py yet and I been able to run the training for around 3h… Wondering with the np.ceil function might be causing the issue…
I could ignore it as the training works, but crashes when encountering a corner case
thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:8
Top GitHub Comments
It might because a bug in croping image, it change
data
’s shape. I add a reassignment line todata_height
anddata_width
. It seems solve this problem. https://github.com/jwyang/faster-rcnn.pytorch/blob/624608fd2f1fb332ef585062cfe51fabf718430d/lib/roi_data_layer/roibatchLoader.py#L160data_height, data_width = data[0].size(0), data[0].size(1)
add this line after line 160.I have fixed the problem with it, thank you!