This repository is the pytorch implementation of Channel Pruning for Accelerating Very Deep Neural Networks and AMC: AutoML for Model Compression and Acceleration on Mobile Devices, the code is inspired by the tensorflow implementation.
- python>=3.5
- pytorch>=0.4.1
- sklearn
- tensorboardX(optional)
python3 cifar_train_eval.py \\
--model plain20
--log_name plain20_baseline \\
python3 cifar_search.py \\
--model plain20 \\
--pretrain_name plain20_baseline\\
--log_name search_plain20_flops0.5 \\
--method channel_pruning \\
--lim_type flops \\
--lim_ratio 0.5 \\
--max_steps 500
python3 cifar_finetune.py \\
--search_name search_plain20_flops0.5 \\
--pretrain_name plain20_baseline \\
--model plain20 \\
--method channel_pruning \\
--lim_type flops \\
--lim_ratio 0.5 \\
--lr 0.01 \\
--max_epochs 100
Model | Acc. | Acc. after pruning | Acc. after finetune |
---|---|---|---|
Plain-20 | 91.22% | 80.01% | 89.86% |