tonylins / pytorch-mobilenet-v2

A PyTorch implementation of MobileNet V2 architecture and pretrained model.
Apache License 2.0
1.37k stars 328 forks source link

The InvertedResidual module. No matter expansion is 1 or 6. There should be a bottle neck. pw+dw+pw(linear) #28

Closed longxianlei closed 5 years ago

longxianlei commented 5 years ago

The InvertedResidual module. No matter expansion is 1 or 6. There should be a bottle neck. pw+dw+pw(linear). But the code is if expansion is 1, then, only dw+pw-linear. ` nn.Conv2d(in_channels, inner_channels, kernel_size=3, stride=stride, padding=1, groups=inner_channels, bias=False), nn.BatchNorm2d(inner_channels), nn.ReLU6(inplace=True),

pw-linear

            nn.Conv2d(inner_channels, out_channels, 1, 1, 0, bias=False),
            nn.BatchNorm2d(out_channels),`
tonylins commented 5 years ago

This is the same as the official TensorFlow implementation. https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet_v2.py