From 421a92144b790d1d110d3653e4ab8fc7c8c6a1d4 Mon Sep 17 00:00:00 2001 From: Guanghua Yu <742925032@qq.com> Date: Mon, 30 Aug 2021 19:47:02 +0800 Subject: [PATCH] fix cascade_mask_rcnn export model (#4089) --- configs/cascade_rcnn/README.md | 1 - ppdet/engine/export_utils.py | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/cascade_rcnn/README.md b/configs/cascade_rcnn/README.md index e6a56ca88..ed43a95a4 100644 --- a/configs/cascade_rcnn/README.md +++ b/configs/cascade_rcnn/README.md @@ -11,7 +11,6 @@ | ResNet50-vd-SSLDv2-FPN | Cascade Mask | 1 | 1x | ---- | 44.9 | 39.1 | [下载链接](https://paddledet.bj.bcebos.com/models/cascade_mask_rcnn_r50_vd_fpn_ssld_1x_coco.pdparams) | [配置文件](https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.2/configs/cascade_rcnn/cascade_mask_rcnn_r50_vd_fpn_ssld_1x_coco.yml) | | ResNet50-vd-SSLDv2-FPN | Cascade Mask | 1 | 2x | ---- | 45.7 | 39.7 | [下载链接](https://paddledet.bj.bcebos.com/models/cascade_mask_rcnn_r50_vd_fpn_ssld_2x_coco.pdparams) | [配置文件](https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.2/configs/cascade_rcnn/cascade_mask_rcnn_r50_vd_fpn_ssld_2x_coco.yml) | -**注意:** Cascade R-CNN模型精度依赖Paddle develop分支修改,精度复现须使用[每日版本](https://www.paddlepaddle.org.cn/documentation/docs/zh/install/Tables.html#whl-dev)或2.0.1版本(将于2021.03发布),使用Paddle 2.0.0版本会有少量精度损失。 ## Citations ``` diff --git a/ppdet/engine/export_utils.py b/ppdet/engine/export_utils.py index a2c19c8c5..c3d339cd4 100644 --- a/ppdet/engine/export_utils.py +++ b/ppdet/engine/export_utils.py @@ -119,7 +119,8 @@ 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' in infer_arch: + if 'mask_head' in config[config['architecture']] and config[config[ + 'architecture']]['mask_head']: infer_cfg['mask'] = True label_arch = 'detection_arch' if infer_arch in KEYPOINT_ARCH: -- GitLab