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.
You only need two things:
- File
architecture.py. It contains a definition of the graph. - Checkpoint. You can load it into the graph using
tf.train.Saverortf.train.init_from_checkpoint.
For an example of using the pretrained model see: inference_with_trained_model.ipynb.
| 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.
- Using moving averages of weights doesn't increase accuracy for some reason.
- for using the pretrained models:
tensorflow 1.10 - for dataset preparation:
pandas, Pillow, tqdm, opencv, ...
- Prepare ImageNet. See
data/README.md. - Set the right parameters in the beginning of
train.pyfile. - Run
python train.py. - Run
tensorboardto see the loss curves. Examples of loss curves are inimages/. - Use
evaluation.ipynbfor the final evaluation on ImageNet.
The training code is heavily inspired by: