From eaa3c0cb95dde5562d7ba449a0dd38b2a0748ebb Mon Sep 17 00:00:00 2001 From: whs Date: Thu, 18 Apr 2019 01:33:27 +0800 Subject: [PATCH] 1. Enable GC strategy in run.sh (#2063) 2. Fix loading checkpoint in filter pruning strategy by adding init_model option into config file. --- PaddleSlim/configs/filter_pruning_sen.yaml | 1 + PaddleSlim/configs/filter_pruning_uniform.yaml | 1 + PaddleSlim/configs/quantization_pruning.yaml | 1 + PaddleSlim/run.sh | 4 ++++ 4 files changed, 7 insertions(+) diff --git a/PaddleSlim/configs/filter_pruning_sen.yaml b/PaddleSlim/configs/filter_pruning_sen.yaml index 4537405f..f83079f5 100644 --- a/PaddleSlim/configs/filter_pruning_sen.yaml +++ b/PaddleSlim/configs/filter_pruning_sen.yaml @@ -20,6 +20,7 @@ strategies: metric_name: 'acc_top1' compressor: epoch: 200 + #init_model: './checkpoints/0' # Please enable this option for loading checkpoint. checkpoint_path: './checkpoints/' strategies: - sensitive_pruning_strategy diff --git a/PaddleSlim/configs/filter_pruning_uniform.yaml b/PaddleSlim/configs/filter_pruning_uniform.yaml index 1dea1070..798e7f1b 100644 --- a/PaddleSlim/configs/filter_pruning_uniform.yaml +++ b/PaddleSlim/configs/filter_pruning_uniform.yaml @@ -16,6 +16,7 @@ strategies: metric_name: 'acc_top1' compressor: epoch: 200 + #init_model: './checkpoints/0' # Please enable this option for loading checkpoint. checkpoint_path: './checkpoints/' strategies: - uniform_pruning_strategy diff --git a/PaddleSlim/configs/quantization_pruning.yaml b/PaddleSlim/configs/quantization_pruning.yaml index b4dcd479..04990510 100644 --- a/PaddleSlim/configs/quantization_pruning.yaml +++ b/PaddleSlim/configs/quantization_pruning.yaml @@ -30,6 +30,7 @@ strategies: activation_quantize_type: 'abs_max' compressor: epoch: 142 + #init_model: './checkpoints/0' # Please enable this option for loading checkpoint. checkpoint_path: './checkpoints/' strategies: - uniform_pruning_strategy diff --git a/PaddleSlim/run.sh b/PaddleSlim/run.sh index eaed30b8..0d370e98 100644 --- a/PaddleSlim/run.sh +++ b/PaddleSlim/run.sh @@ -24,6 +24,10 @@ fi cd - +# enable GC strategy +export FLAGS_fast_eager_deletion_mode=1 +export FLAGS_eager_delete_tensor_gb=0.0 + # for distillation #----------------- export CUDA_VISIBLE_DEVICES=0,1,2,3 -- GitLab