diff --git a/tools/export_utils.py b/tools/export_utils.py index a357a4f39f7b1b1e50406ec3890caec32aa1a59c..48068b5e60519d7954c850a6d58bba77386914a0 100644 --- a/tools/export_utils.py +++ b/tools/export_utils.py @@ -109,7 +109,7 @@ def dump_infer_config(config, path, image_shape, model): 'Architecture: {} is not supported for exporting model now'.format( infer_arch)) os._exit(0) - if 'mask_post_process' in model.__dict__: + if getattr(model.__dict__, 'mask_post_process', None): infer_cfg['mask_resolution'] = model.mask_post_process.mask_resolution infer_cfg['with_background'], infer_cfg['Preprocess'], infer_cfg[ 'label_list'], image_shape = parse_reader(