Coder Social home page Coder Social logo

mobilenetv2's Introduction

MobileNetV2

Implementation of MobileNetV2 with pyTorch, adapted from MobileNetV2-PyTorch and pytorch-mobilenet-v2.

Theory

 You can find the paper of MobileNetV2 at Inverted Residuals and Linear Bottlenecks: Mobile Networks for Classification, Detection and Segment.

Usage

 This project uses Python 3.7.3 and PyTorch 1.0.1.

Prepare data

 The ImageNet dataset is used in this project and is put as follows (Copied from miraclewkf/MobileNetV2-PyTorch where you can find the files ILSVRC2012_img_train and ILSVRC2012_img_val).

├── train.py # train script
├── MobileNetV2.py # network of MobileNetV2
├── read_ImageNetData.py
├── ImageData
  ├── ILSVRC2012_img_train
    ├── n01440764
    ├──    ...
    ├── n15075141
  ├── ILSVRC2012_img_val
  ├── ILSVRC2012_dev_kit_t12
    ├── data
      ├── ILSVRC2012_validation_ground_truth.txt
      ├── meta.mat

Train

  • Train from scratch:
CUDA_VISIBLE_DEVICES=0,1 python train.py --batch-size 128
  • Train from one checkpoint(for example, train from epoch_200.pth, the --start-epoch parameter is corresponding to the epoch of the checkpoint):
CUDA_VISIBLE_DEVICES=2,3 python train.py --batch-size 256 --resume /media/data2/chenjiarong/MobileNetV2/output/epoch_200.pth --start-epoch 200 --num-epochs 300

Pretrained models

 In pretrained, achieving an accuracy of 71.62%.

Experiments

training setting:

  1. number of epochs: 400
  2. learning rate schedule: learning rate decay rate of 0.98 per epoch, initial lr=0.045
  3. weight decay: 4e-5
  4. remove dropout
  5. batch size: 256
  6. optimizer: SGD

MobileNetV2

Madds Parameters Top1-acc
Offical 1.0 300 M 3.4 M 72.0%
Ours 1.0 (Madds&Parameters calculated by thop) 328.78 M 3.5 M 71.62%
Ours 1.0 (Madds&Parameters calculated by torchsummaryX) 300.79 M 3.5 M 71.62%

mobilenetv2's People

Contributors

showlo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mobilenetv2's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.