Se resnext101 size mismatch
jaideep11061982 opened this issue · comments
jaideep11061982 commented
Hi i get a size mismatch issue for se resnext 101 32 x4d
I changed the classes to 1 from 1000.
size mismatch, m1: [80 x 8192], m2: [2048 x 1] at /opt/conda/conda-bld/pytorch_1556653099582/work/aten/src/THC/generic/THCTensorMathBlas.cu:268
Mamat Shamshiev commented
Probably shape of your input differs from (3, 224, 224). As far as I understand, In implementation of SENet 2D average pooling is used (not global average pooling)
That's why the mismatch happens in case of images of different shape.
You may change self.avg_pool attribute to nn.AdaptiveAvgPool2d((1, 1)) and it probably should work.