未验证 提交 3146ebe0 编写于 作者: W whs 提交者: GitHub

Fix loading checkpoint in eval script of pruning demo. (#391)

上级 f9702922
......@@ -86,6 +86,7 @@ def main():
fetches = model.eval(feed_vars, multi_scale_test)
eval_prog = eval_prog.clone(True)
exe.run(startup_prog)
reader = create_reader(cfg.EvalReader)
loader.set_sample_list_generator(reader, place)
......@@ -123,7 +124,7 @@ def main():
params=pruned_params,
ratios=pruned_ratios,
place=place,
only_graph=True)
only_graph=False)
pruned_flops = flops(eval_prog)
logger.info("pruned FLOPS: {}".format(
float(base_flops - pruned_flops) / base_flops))
......@@ -174,7 +175,6 @@ def main():
sub_eval_prog = sub_eval_prog.clone(True)
# load model
exe.run(startup_prog)
if 'weights' in cfg:
checkpoint.load_checkpoint(exe, eval_prog, cfg.weights)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册