diff --git a/tools/eval.py b/tools/eval.py index 14d3953684b57c46dbcbd6246270e886281b8015..3b1a90f22f9cb5dc3f58614ad7791da5db0ab362 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 10e2ea0eb71e924e993cf99cd69811c64622d4cd..e977b068b18a6cf8b02caaef2f0dd33f2fb9b5a2 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],