talebolano / yolov3-network-slimming

yolov3 network slimming剪枝的一种实现
344 stars 93 forks source link
network pruning pytorch slimming yolo

yolov3-network-slimming

LICENSE

Learning Efficient Convolutional Networks Through Network Slimming (ICCV 2017)应用在yolov3和yolov2上

环境

pytorch 0.41

window 10

如何使用

1.对原始weights文件进行稀疏化训练

python sparsity_train.py -sr --s 0.0001 --image_folder coco.data --cfg yolov3.cfg --weights yolov3.weights

2.剪枝

python prune.py --cfg yolov3.cfg --weights checkpoints/yolov3_sparsity_100.weights --percent 0.3

3.对剪枝后的weights进行微调

python sparsity_train.py --image_folder coco.data --cfg prune_yolov3.cfg --weights prune_yolov3.weights

关于new_prune.py

new_prune更新了算法,现在可以确保不会有某一层被减为0的情况发生,参考RETHINKING THE SMALLER-NORM-LESSINFORMATIVE ASSUMPTION IN CHANNEL PRUNING OF CONVOLUTION LAYERS(ICLR 2018)对剪枝后bn层β系数进行了保留

待完成

coco测试