From be2c012bb4048d3fe032b5194253095588324e0b Mon Sep 17 00:00:00 2001 From: whs Date: Fri, 8 May 2020 11:31:15 +0800 Subject: [PATCH] Fix eval_run in demo of pruning and sensitivity (#611) --- slim/prune/prune.py | 10 ++++++++-- slim/sensitive/sensitive.py | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/slim/prune/prune.py b/slim/prune/prune.py index 9c0d2bf24..cdfa255ee 100644 --- a/slim/prune/prune.py +++ b/slim/prune/prune.py @@ -293,8 +293,14 @@ def main(): if FLAGS.eval: # evaluation - results = eval_run(exe, compiled_eval_prog, eval_loader, - eval_keys, eval_values, eval_cls) + results = eval_run( + exe, + compiled_eval_prog, + eval_loader, + eval_keys, + eval_values, + eval_cls, + cfg=cfg) resolution = None if 'mask' in results[0]: resolution = model.mask_head.resolution diff --git a/slim/sensitive/sensitive.py b/slim/sensitive/sensitive.py index 495b5082f..c04c38e1c 100644 --- a/slim/sensitive/sensitive.py +++ b/slim/sensitive/sensitive.py @@ -131,8 +131,14 @@ def main(): compiled_eval_prog = fluid.compiler.CompiledProgram(program) - results = eval_run(exe, compiled_eval_prog, eval_loader, eval_keys, - eval_values, eval_cls) + results = eval_run( + exe, + compiled_eval_prog, + eval_loader, + eval_keys, + eval_values, + eval_cls, + cfg=cfg) resolution = None if 'mask' in results[0]: resolution = model.mask_head.resolution -- GitLab