Coder Social home page Coder Social logo

cscn89 / shufflenet-v2-tensorflow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tropcomplique/shufflenet-v2-tensorflow

0.0 2.0 0.0 296 KB

a lightweight convolutional neural network

License: MIT License

Python 46.56% Jupyter Notebook 53.44%

shufflenet-v2-tensorflow's Introduction

ShuffleNet v2

This is an implementation of ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design .

model accuracy top 5 accuracy
0.5x 0.607 0.822
1.0x 0.688 0.886

You can download ImageNet trained checkpoints from here.

How to use the pretrained models

You only need two things:

  1. File architecture.py. It contains a definition of the graph.
  2. Checkpoint. You can load it into the graph using tf.train.Saver or tf.train.init_from_checkpoint.

For an example of using the pretrained model see: inference_with_trained_model.ipynb.

Speed benchmarks

model accuracy images/second
ShuffleNet v2 0.5x 0.607 3192
ShuffleNet v2 1.0x 0.689 2349
ShuffleNet v2 1.5x - 1855
ShuffleNet v2 2.0x - 1570
MobileNet v1 0.5x 0.633 3317
MobileNet v1 0.75x 0.684 2187
MobileNet v1 1.0x 0.709 1685
MobileNet v2 0.35x 0.603 2722
MobileNet v2 0.75x 0.698 1527
MobileNet v2 1.0x 0.718 1292

All measurements were done using batches of size 8, images of size 224x224, and NVIDIA GTX 1080 Ti.
See benchmark_speed.ipynb for the code.

MobileNet v1 results are taken from here. MobileNet v2 results are taken from here.

Notes

  1. Using moving averages of weights doesn't increase accuracy for some reason.

Requirements

  1. for using the pretrained models: tensorflow 1.10
  2. for dataset preparation: pandas, Pillow, tqdm, opencv, ...

How to train

  1. Prepare ImageNet. See data/README.md.
  2. Set the right parameters in the beginning of train.py file.
  3. Run python train.py.
  4. Run tensorboard to see the loss curves. Examples of loss curves are in images/.
  5. Use evaluation.ipynb for the final evaluation on ImageNet.

Credit

The training code is heavily inspired by:

  1. https://github.com/tensorflow/models/tree/master/official/resnet
  2. https://cloud.google.com/tpu/docs/inception-v3-advanced

Other implementations

  1. miaow1988/ShuffleNet_V2_pytorch_caffe
  2. tensorpack/examples/ImageNetModels

shufflenet-v2-tensorflow's People

Contributors

tropcomplique avatar

Watchers

James Cloos avatar  avatar

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.