deform_conv_pytorch icon indicating copy to clipboard operation
deform_conv_pytorch copied to clipboard

ValueError: cannot reshape array of size 18 into shape (1,128,1,1)

Open Esaada opened this issue 6 years ago • 3 comments

You did: N = offset.size(1) // 2, In that level the offset.size(1) is equal to 128 , and N suppuse to be the kernel size *2, means N=|R|

And I haven't change anything in the code...

Thanks.

Esaada avatar Dec 04 '18 12:12 Esaada

I have the same issue, please help. Beside it is not clear that why out_channel is 18. Can you explain briefly? self.conv_offset = nn.Conv2d(in_channels=inC, out_channels=18, kernel_size=3, padding=padding, bias=None)

Simpatech-app avatar Apr 02 '19 13:04 Simpatech-app

Size mismatch because of the linear layer... do a reshape or adaptive pooling or leave the linear layer out. have a look at this implementation: https://github.com/bkvie/Locally-Consistent-Deformable-Convolution

bkvie avatar May 14 '19 10:05 bkvie

I have the same problem……

H-Wenfeng avatar May 27 '20 07:05 H-Wenfeng