Git Product home page Git Product logo

shufflenetv2-pytorch's Introduction

ShuffleNetv2 in PyTorch

An implementation of ShuffleNetv2 in PyTorch. ShuffleNetv2 is an efficient convolutional neural network architecture for mobile devices. For more information check the paper: ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design

Usage

Clone the repo:

git clone https://github.com/Randl/ShuffleNetV2-pytorch
pip install -r requirements.txt

Use the model defined in model.py to run ImageNet example:

python imagenet.py --dataroot "/path/to/imagenet/"

To continue training from checkpoint

python imagenet.py --dataroot "/path/to/imagenet/" --resume "/path/to/checkpoint/folder"

Results

For x0.5 model I achieved 0.4% lower top-1 accuracy than claimed.

Classification Checkpoint MACs (M) Parameters (M) Top-1 Accuracy Top-5 Accuracy Claimed top-1 Claimed top-5
[shufflenet_v2_0.5] 41 1.37 59.86 81.63 60.3 -

You can test it with

python imagenet.py --dataroot "/path/to/imagenet/" --resume "results/shufflenet_v2_0.5/model_best.pth.tar" -e --scaling 0.5

shufflenetv2-pytorch's People

Contributors

randl avatar sxj731533730 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shufflenetv2-pytorch's Issues

Extremely slow data load when training on ImageNet

Thanks for your excellent work. I found that the data load speed is very slow when training the shuffleNetV2-0.5X. The GPU is basically not working. I use one SSD and 10 workers to load data.
Normally the data load for a batch of 256 requires less than 0.1s, but it becomes more than 10s now. It seems that GPU is much more fast than the data loading process. I wonder if you have solution for this problem? Thanks.

I met this error when run "python3 imagenet.py".

Hi, @Randl

I met this error when run "python3 imagenet.py --dataroot "pl_5plus3/" --resume "model_best.pth.tar" -e --scaling 0.5".

...
)
number of parameters: 1372120
FLOPs: 40376352.0
=> loading checkpoint 'model_best.pth.tar'
Traceback (most recent call last):
File "imagenet.py", line 215, in
main()
File "imagenet.py", line 152, in main
model.load_state_dict(checkpoint['state_dict'])
File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 769, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for ShuffleNetV2:
Missing key(s) in state_dict: "conv1.weight", "bn1.weight", "bn1.bias", "bn1.running_mean", "bn1.running_var", "shuffles.ShuffleConvs_0.DownsampleUnit.conv1r.weight", "shuffles.ShuffleConvs_0.DownsampleUnit.bn1r.weight", "shuffles.ShuffleConvs_0.DownsampleUnit.bn1r.bias", "shuffles.ShuffleConvs_0.DownsampleUnit.bn1r.running_mean", "shuffles.ShuffleConvs_0.DownsampleUnit.bn1r.running_var", "shuffles.ShuffleConvs_0.DownsampleUnit.conv2r.weight", "shuffles.ShuffleConvs_0.DownsampleUnit.bn2r.weight", "shuffles.ShuffleConvs_0.DownsampleUnit.bn2r.bias", "shuffles.ShuffleConvs_0.DownsampleUnit.bn2r.running_mean", "shuffles.ShuffleConvs_0.DownsampleUnit.bn2r.running_var", "shuffles.ShuffleConvs_0.DownsampleUnit.conv3r.weight", "shuffles.ShuffleConvs_0.DownsampleUnit.bn3r.weight", "shuffles.ShuffleConvs_0.DownsampleUnit.bn3r.bias", "shuffles.ShuffleConvs_0.DownsampleUnit.bn3r.running_mean", "shuffles.ShuffleConvs_0.DownsampleUnit.bn3r.running_var",
...
What;s wrong to me ??

Thanks in advance ~
Best,
@bemoregt.

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.