From 7257a36495dcd1b8ac57ba2e48b2a9f373ecf60e Mon Sep 17 00:00:00 2001 From: Guanghua Yu <742925032@qq.com> Date: Fri, 11 Dec 2020 19:02:01 +0800 Subject: [PATCH] fix condition of mask (#1881) --- tools/eval.py | 3 ++- tools/infer.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/eval.py b/tools/eval.py index 14d395368..3b1a90f22 100755 --- a/tools/eval.py +++ b/tools/eval.py @@ -109,7 +109,8 @@ def run(FLAGS, cfg, place): use_default_label) mask_resolution = None - if cfg['MaskPostProcess']['mask_resolution'] is not None: + if 'Mask' in cfg.architecture and cfg['MaskPostProcess'][ + 'mask_resolution'] is not None: mask_resolution = int(cfg['MaskPostProcess']['mask_resolution']) infer_res = get_infer_results( outs_res, diff --git a/tools/infer.py b/tools/infer.py index 10e2ea0eb..e977b068b 100755 --- a/tools/infer.py +++ b/tools/infer.py @@ -161,7 +161,8 @@ def run(FLAGS, cfg, place): im_ids = data[fields.index('im_id')].numpy() mask_resolution = None - if cfg['MaskPostProcess']['mask_resolution'] is not None: + if 'Mask' in cfg.architecture and cfg['MaskPostProcess'][ + 'mask_resolution'] is not None: mask_resolution = int(cfg['MaskPostProcess']['mask_resolution']) batch_res = get_infer_results( [outs], -- GitLab