The implementation of "AACP: Model Compression by Accurate and Automatic Channel Pruning"(accepted by ICPR2022), by Lanbo Lin, Shengjie Chen, Yujiu Yang and Zhenhua Guo.
Before running the code, installing the packages in requirements.txt. Note that the apex is required to be install by compiling the source code to avoid errors occur. You can install apex by:
git clone https://github.com/NVIDIA/apex.git
cd apex
pip install -v --no-cache-dir ./
We provide the code of pruning VGG16/Resnet56/Resnet110 on CIFAR10 and Resnet50/Mobilenetv2 on ImageNet (ILSVRC2012). All commands are run in the directory of " your_path/AACP"
cd your_path/AACP
- Train an unpruned VGG16 model. Change the configurations and run
bash scripts/train_cifar10_vgg.sh
- Search the optimal pruned architecture and finetune the searched result. Change the configurations and run
bash scripts/prune_cifar10_vgg.sh
Logs are saved to ./results by default.
- Train an unpruned Resnet56 model. Change the configurations and run
bash scripts/train_cifar10_resnet56.sh
- Search the optimal pruned architecture and finetune the searched result. Change the configurations and run
bash scripts/prune_cifar10_resnet56.sh
- Train an unpruned Resnet56 model. Change the configurations and run
bash scripts/train_cifar10_resnet110.sh
- Search the optimal pruned architecture and finetune the searched result. Change the configurations and run
bash scripts/prune_cifar10_resnet110.sh
- Train an unpruned Resnet50 model. Change the configurations and run
bash scripts/train_imagenet_resnet50.sh
- Search the optimal pruned architecture. Change the configurations and run
bash scripts/prune_imagenet_resnet50.sh
- Finetune the searched result. Change the configurations and run
bash scripts/finetune_imagenet_resnet50.sh
- Train an unpruned mobilenetv2 model. Change the configurations and run
bash scripts/train_imagenet_mobilenetv2.sh
- Search the optimal pruned architecture. Change the configurations and run
bash scripts/prune_imagenet_mobilenetv2.sh
- Finetune the searched result. Change the configurations and run
bash scripts/finetune_imagenet_mobilenetv2.sh
Coming soon.