xhp-hust-2018-2011 / SS-DCNet

From Open Set to Closed Set: Supervised Spatial Divide-and-Conquer for Object Counting
78 stars 19 forks source link

[Error] size mismatch ? #3

Closed MohamedAliRashad closed 4 years ago

MohamedAliRashad commented 4 years ago
>>> cl2h[:,:,rx::rate,ry::rate] = chigh[:,:,rx::rate,ry::rate]*clow
RuntimeError: The size of tensor a (23) must match the size of tensor b (22) at non-singleton dimension 3

I think the problem in the input size of the images, so i was asking what was the input sizes and how to control it ?

ZhaozwTD commented 4 years ago

I have the same RuntimeError with MohamedAliRashad that is "RuntimeError: The size of tensor a (8) must match the size of tensor b (7) at non-singleton dimension 3" when I infer single image.

xhp-hust-2018-2011 commented 4 years ago

Make sure you have padded the image to be divisible by 64.

xhp-hust-2018-2011 commented 4 years ago

The padding is achieved in load_data_V2.py line 69, 'image = get_pad(image,DIV=64)'.

MohamedAliRashad commented 4 years ago

@xhp-hust-2018-2011 Thanks.