666DZY666 / micronet

micronet, a model compression and deploy lib. compression: 1、quantization: quantization-aware-training(QAT), High-Bit(>2b)(DoReFa/Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inference)、Low-Bit(≤2b)/Ternary and Binary(TWN/BNN/XNOR-Net); post-training-quantization(PTQ), 8-bit(tensorrt); 2、 pruning: normal、regular and group convolutional channel pruning; 3、 group convolution structure; 4、batch-normalization fuse for quantization. deploy: tensorrt, fp32/fp16/int8(ptq-calibration)、op-adapt(upsample)、dynamic_shape
MIT License
2.21k stars 478 forks source link

pruning方案存在问题 #37

Open euminds opened 4 years ago

euminds commented 4 years ago

1.prunin文件下的main函数超参数输入如下 Options: Namespace(cpu=False, data='../data', epochs=300, eval_batch_size=256, evaluate=False, gpu_id='', lr=0.01, num_workers=2, refine='', resume='', s=0.001, sr=True, train_batch_size=512, wd=1e-07) 稀疏训练后,模型准确率为89.21% 2.根据该稀疏模型,做正常剪枝/规整剪枝,超参数如下 Namespace(cpu=False, data='../data', layers=9, model='models_save/nin_preprune.pth', normal_regular=1, percent=0.5, save='models_save/nin_prune.pth') 问题: !please turn down the prune_ratio!

layer_index: 3 total_channel: 192 remaining_channel: 1 pruned_ratio: 0.994792

!please turn down the prune_ratio!

layer_index: 6 total_channel: 160 remaining_channel: 1 pruned_ratio: 0.993750

!please turn down the prune_ratio!

layer_index: 10 total_channel: 96 remaining_channel: 1 pruned_ratio: 0.989583

!please turn down the prune_ratio!

layer_index: 15 total_channel: 192 remaining_channel: 1 pruned_ratio: 0.994792

!please turn down the prune_ratio!

layer_index: 19 total_channel: 192 remaining_channel: 1 pruned_ratio: 0.994792

!please turn down the prune_ratio!

layer_index: 23 total_channel: 192 remaining_channel: 1 pruned_ratio: 0.994792

!please turn down the prune_ratio!

layer_index: 28 total_channel: 192 remaining_channel: 1 pruned_ratio: 0.994792

!please turn down the prune_ratio!

layer_index: 32 total_channel: 192 remaining_channel: 1 pruned_ratio: 0.994792 剪完后的通道数异常,全部仅为1,调整percent=0.9仍出现相同错误;规整剪枝同样存在以下问题。 是否因为稀疏训练时设置的s只能为0.0001

666DZY666 commented 3 years ago

试试s=0.0001。应该是稀疏程度大了。