https://github.com/zjcv/networkslimming
[ICCV 2017] Learning Efficient Convolutional Networks through Network Slimming
https://github.com/zjcv/networkslimming
channel-pruning mobilenet network-pruning network-slimming pytorch resnet vggnet zcls
Last synced: 5 months ago
JSON representation
[ICCV 2017] Learning Efficient Convolutional Networks through Network Slimming
- Host: GitHub
- URL: https://github.com/zjcv/networkslimming
- Owner: ZJCV
- License: apache-2.0
- Created: 2021-07-19T15:12:39.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-09T14:37:08.000Z (about 4 years ago)
- Last Synced: 2025-05-12T20:20:12.294Z (5 months ago)
- Topics: channel-pruning, mobilenet, network-pruning, network-slimming, pytorch, resnet, vggnet, zcls
- Language: Python
- Homepage:
- Size: 58.6 KB
- Stars: 6
- Watchers: 0
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
«NetworkSlimming» re-implements the paper Learning Efficient Convolutional Networks through Network Slimming
![]()
![]()
![]()
More training statistics can see:
* [Details](./docs/details.md)
## Table of Contents
- [Table of Contents](#table-of-contents)
- [Background](#background)
- [Usage](#usage)
- [Maintainers](#maintainers)
- [Thanks](#thanks)
- [Contributing](#contributing)
- [License](#license)## Background
`Network Slimming` uses `L1` regularization to sparsely train the BN layer's `scaling factor`; After the training, it performs channel-level pruning operation; Finally, by fine-tuning to recovery performance. it achieves good results in practical application.
## Usage
First, you need set env for `PYTHONPATH` and `CUDA_VISIBLE_DEVICES`
```angular2html
$ export PYTHONPATH=
$ export CUDA_VISIBLE_DEVICES=0
```Then, begin `train-prune-finetuning`
* For train
```
$ python tools/train.py -cfg=configs/vggnet/vgg16_bn_cifar100_224_e100_sgd_mslr_slim_1e_4.yaml
```* For prune
```angular2html
$ python tools/prune/prune_vggnet.py
```* For fine-tuning
```angular2html
$ python tools/train.py -cfg=configs/vggnet/refine_pruned_0_2_vgg16_bn_cifar100_224_e100_sgd_mslr_slim_1e_4.yaml
```Finally, set the fine-tuning model path in the `PRELOADED` option of the configuration file
```angular2html
$ python tools/test.py -cfg=configs/vggnet/refine_pruned_0_2_vgg16_bn_cifar100_224_e100_sgd_mslr_slim_1e_4.yaml
```## Maintainers
* zhujian - *Initial work* - [zjykzj](https://github.com/zjykzj)
## Thanks
* [ Eric-mingjie/network-slimming ](https://github.com/Eric-mingjie/network-slimming)
* [ wlguan/MobileNet-v2-pruning ](https://github.com/wlguan/MobileNet-v2-pruning)
* [ 666DZY666/micronet](https://github.com/666DZY666/micronet)
* [ foolwood/pytorch-slimming ](https://github.com/foolwood/pytorch-slimming)```
@misc{liu2017learning,
title={Learning Efficient Convolutional Networks through Network Slimming},
author={Zhuang Liu and Jianguo Li and Zhiqiang Shen and Gao Huang and Shoumeng Yan and Changshui Zhang},
year={2017},
eprint={1708.06519},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
```## Contributing
Anyone's participation is welcome! Open an [issue](https://github.com/ZJCV/NetworkSlimming/issues) or submit PRs.
Small note:
* Git submission specifications should be complied
with [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0-beta.4/)
* If versioned, please conform to the [Semantic Versioning 2.0.0](https://semver.org) specification
* If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme)
specification.## License
[Apache License 2.0](LICENSE) © 2021 zjykzj