Why do you use conv and bn in SeModule?
kuan-wang opened this issue · 3 comments
kuan-wang commented
Your SEModule is different from what the paper claimed. You can change it refer to https://github.com/moskomule/senet.pytorch/blob/master/senet/se_module.py
or my impementation https://github.com/kuan-wang/pytorch-mobilenet-v3/blob/master/mobilenetv3.py.
xiaolai-sqlai commented
Sorry, it's my fault to do so, I have retrain it, new model mbv3_small also get top-1 69.037, I have updated it.
Dawson-huang commented
hi, it is a mistake in se module that use nn.Conv2d instead of nn.Linear:
self.se = nn.Sequential(
nn.AdaptiveAvgPool2d(1),
nn.Conv2d(in_size, in_size // reduction, kernel_size=1, stride=1, padding=0, bias=False),
nn.BatchNorm2d(in_size // reduction),
nn.ReLU(inplace=True),
nn.Conv2d(in_size // reduction, in_size, kernel_size=1, stride=1, padding=0, bias=False),
nn.BatchNorm2d(in_size),
hsigmoid()
)
when I convert this model to caffe version, I got a error like this:
F1015 11:07:24.302090 4099 eltwise_layer.cpp:34] Check failed: bottom[0]->shape() == bottom[i]->shape() bottom[0]: 1 16 56 56 (50176), bottom[1]: 1 16 1 1 (16)
maybe it can get a bottom: 1 16 (16)
with nn.Linear in pytorch version which successfully achieve Operation x * self.se(x)
in SeModule.
zihaozhang9 commented