paddle slim裁剪+量化 中途报错的问题
Created by: wwjjy
使用Uniform裁剪mobilenet时,裁剪过后的fine-tune训练会报错,错误类型如下: 看起来像是裁剪过后的通道数和分组卷积的group数不同导致的,但是如果紧跟着量化训练的话,模型就可以正常的训练。请问这是什么问题呀。具体的配置如下:
pruners:
pruner_1:
class: 'StructurePruner'
pruning_axis:
'*': 0
criterions:
'*': 'l1_norm'
strategies:
uniform_pruning_strategy:
class: 'UniformPruneStrategy'
pruner: 'pruner_1'
start_epoch: 5
target_ratio: 0.5
pruned_params: 'conv'
metric_name: 'acc_top1'
quantization_strategy:
class: 'QuantizationStrategy'
start_epoch: 10
end_epoch: 15
float_model_save_path: './output/float'
mobile_model_save_path: './output/mobile'
int8_model_save_path: './output/int8'
weight_bits: 8
activation_bits: 8
weight_quantize_type: 'abs_max'
activation_quantize_type: 'abs_max'
save_in_nodes: ['image']
save_out_nodes: ['fc_0.tmp_2']
compressor:
epoch: 16
checkpoint_path: './checkpoints_model/'
strategies:
- uniform_pruning_strategy
- quantization_strategy