提交 5970f5b6 编写于 作者: W wanghaoshuang

Fix greedy pruner.

上级 e095fa06
......@@ -217,7 +217,7 @@ def compress(args):
train(i, pruned_program)
acc = test(i, pruned_val_program)
print("iter:{}; pruned FLOPS: {}; acc: {}".format(
iter, float(base_flops - current_flops) / base_flops), acc)
iter, float(base_flops - current_flops) / base_flops, acc))
pruner.save_checkpoint(pruned_program, pruned_val_program)
......
......@@ -57,12 +57,15 @@ def sensitivity(program,
if ratio in sensitivities[name]['pruned_percent']:
_logger.debug('{}, {} has computed.'.format(name, ratio))
ratio += step_size
pruned_times += 1
continue
if baseline is None:
baseline = eval_func(graph.program)
param_backup = {}
pruner = Pruner()
_logger.info("sensitive - param: {}; ratios: {}".format(name,
ratio))
pruned_program = pruner.prune(
program=graph.program,
scope=scope,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册