未验证 提交 9dbd3e08 编写于 作者: W whs 提交者: GitHub

Add auto pruning demo. (#2326)

* Add auto pruning demo.

* Fix config file of auto pruning.
上级 a0b7fca3
version: 1.0
pruners:
pruner_1:
class: 'StructurePruner'
pruning_axis:
'*': 0
criterions:
'*': 'l1_norm'
controllers:
sa_controller:
class: 'SAController'
reduce_rate: 0.9
init_temperature: 100
max_iter_number: 300
strategies:
auto_pruning_strategy:
class: 'AutoPruneStrategy'
pruner: 'pruner_1'
controller: 'sa_controller'
start_epoch: 0
end_epoch: 500
retrain_epoch: 0
max_ratio: 0.50
min_ratio: 0.48
uniform_range: 0.4
pruned_params: '.*_sep_weights'
metric_name: 'acc_top1'
compressor:
epoch: 500
checkpoint_path: './checkpoints_auto_pruning/'
strategies:
- auto_pruning_strategy
......@@ -67,6 +67,14 @@ cd -
#--pretrained_model ./pretrain/MobileNetV1_pretrained \
#--compress_config ./configs/filter_pruning_uniform.yaml
# for auto filter pruning
#---------------------------
#export CUDA_VISIBLE_DEVICES=0
#python compress.py \
#--model "MobileNet" \
#--pretrained_model ./pretrain/MobileNetV1_pretrained \
#--compress_config ./configs/auto_prune.yaml
# for quantization
#-----------------
#export CUDA_VISIBLE_DEVICES=0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册