From b12b6b4ffe641653aa71c81bc5f92f34fd57b198 Mon Sep 17 00:00:00 2001 From: sunyanfang01 Date: Tue, 16 Jun 2020 11:08:34 +0800 Subject: [PATCH] add prune configs and prompt --- paddlex/cv/models/slim/prune.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddlex/cv/models/slim/prune.py b/paddlex/cv/models/slim/prune.py index bd6c1aa..f1e5f98 100644 --- a/paddlex/cv/models/slim/prune.py +++ b/paddlex/cv/models/slim/prune.py @@ -158,7 +158,7 @@ def prune_program(model, prune_params_ratios=None): prune_params_ratios (dict): 由裁剪参数名和裁剪率组成的字典,当为None时 使用默认裁剪参数名和裁剪率。默认为None。 """ - assert model.status == 'Normal', 'Only the model after training can be pruned!' + assert model.status == 'Normal', 'Only the models saved while training are supported!' place = model.places[0] train_prog = model.train_prog eval_prog = model.test_prog @@ -236,7 +236,7 @@ def cal_params_sensitivities(model, save_file, eval_dataset, batch_size=8): 其中``weight_0``是卷积Kernel名;``sensitivities['weight_0']``是一个字典,key是裁剪率,value是敏感度。 """ - assert model.status == 'Normal', 'Only the model after training can calculate sensitivities data!' + assert model.status == 'Normal', 'Only the models saved while training are supported!' if os.path.exists(save_file): os.remove(save_file) -- GitLab