BangguWu / ECANet

Code for ECA-Net: Efficient Channel Attention for Deep Convolutional Neural Networks
MIT License
1.26k stars 198 forks source link

About the pre-trained ECA-Net152model. #31

Closed bobo0810 closed 4 years ago

bobo0810 commented 4 years ago

When I load the pre-trained model with default parameters, an error will occur. size mismatch for layer3.0.eca.conv.weight: copying a param with shape torch.Size([1, 1, 5]) from checkpoint, the shape in current model is torch.Size([1, 1, 3]). Can be solved by the following code in line200: k_size=[3, 3, 3, 3] changed to k_size=[3, 3, 5, 7]

BangguWu commented 4 years ago

I rechecked our pre-trained model and code , it is no problem. you could recheck your modification and run commands.

bobo0810 commented 4 years ago

I got it! I only watched eca_resnet.py The default content of eca_resnet.py is eca_resnet152(k_size=[3,3,3,3]) eca_resnet152_k3357.pth.tar means eca_resnet152(k_size=[3,3,5,7])