pytorch-mobilenet

by marvis

PyTorch MobileNet Implementation of "MobileNets: Efficient Convolutional Neural Networks for Mobile ...

435 Stars 120 Forks Last release: Not found 18 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

Implementation of MobileNet, modified from https://github.com/pytorch/examples/tree/master/imagenet. imagenet data is processed as described here

nohup python main.py -a mobilenet ImageNet-Folder > log.txt &

Results - sgd : top1 68.848 top5 88.740 download- rmsprop: top1 0.104 top5 0.494 - rmsprop init from sgd : top1 69.526 top5 88.978 donwload- paper: top1 70.6

Benchmark:

Titan-X, batchsize = 16

resnet18 : 0.004030 alexnet : 0.001395 vgg16 : 0.002310 squeezenet : 0.009848 mobilenet : 0.073611

Titan-X, batchsize = 1

resnet18 : 0.003688 alexnet : 0.001179 vgg16 : 0.002055 squeezenet : 0.003385 mobilenet : 0.076977

class Net(nn.Module): def \_\_init\_\_(self): super(Net, self).\_\_init\_\_() def conv\_bn(inp, oup, stride): return nn.Sequential( nn.Conv2d(inp, oup, 3, stride, 1, bias=False), nn.BatchNorm2d(oup), nn.ReLU(inplace=True) ) def conv\_dw(inp, oup, stride): return nn.Sequential( nn.Conv2d(inp, inp, 3, stride, 1, groups=inp, bias=False), nn.BatchNorm2d(inp), nn.ReLU(inplace=True), nn.Conv2d(inp, oup, 1, 1, 0, bias=False), nn.BatchNorm2d(oup), nn.ReLU(inplace=True), ) self.model = nn.Sequential( conv\_bn( 3, 32, 2), conv\_dw( 32, 64, 1), conv\_dw( 64, 128, 2), conv\_dw(128, 128, 1), conv\_dw(128, 256, 2), conv\_dw(256, 256, 1), conv\_dw(256, 512, 2), conv\_dw(512, 512, 1), conv\_dw(512, 512, 1), conv\_dw(512, 512, 1), conv\_dw(512, 512, 1), conv\_dw(512, 512, 1), conv\_dw(512, 1024, 2), conv\_dw(1024, 1024, 1), nn.AvgPool2d(7), ) self.fc = nn.Linear(1024, 1000) def forward(self, x): x = self.model(x) x = x.view(-1, 1024) x = self.fc(x) return x

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.