From 8db03fb3bc4991ee4d486596f6893b261986a0e8 Mon Sep 17 00:00:00 2001 From: wangguanzhong Date: Wed, 23 Mar 2022 21:51:18 +0800 Subject: [PATCH] update ops (#5443) --- ppdet/modeling/heads/mask_head.py | 2 +- ppdet/modeling/ops.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ppdet/modeling/heads/mask_head.py b/ppdet/modeling/heads/mask_head.py index 5b9de3760..604847a2d 100644 --- a/ppdet/modeling/heads/mask_head.py +++ b/ppdet/modeling/heads/mask_head.py @@ -209,7 +209,7 @@ class MaskHead(nn.Layer): scale_factor (Tensor): The scale factor from origin size to input size """ if not self.export_onnx and rois.shape[0] == 0: - mask_out = paddle.full([1, 1, 1, 1], -1) + mask_out = paddle.full([1, 1, 1], -1) else: bbox = [rois[:, 2:]] labels = rois[:, 0].cast('int32') diff --git a/ppdet/modeling/ops.py b/ppdet/modeling/ops.py index 7d08a1979..52a4f3396 100644 --- a/ppdet/modeling/ops.py +++ b/ppdet/modeling/ops.py @@ -482,6 +482,8 @@ def collect_fpn_proposals(multi_rois, rois_num = helper.create_variable_for_type_inference(dtype='int32') rois_num.stop_gradient = True outputs['RoisNum'] = rois_num + else: + rois_num = None helper.append_op( type='collect_fpn_proposals', inputs=inputs, @@ -602,6 +604,8 @@ def distribute_fpn_proposals(fpn_rois, for i in range(num_lvl) ] outputs['MultiLevelRoIsNum'] = rois_num_per_level + else: + rois_num_per_level = None helper.append_op( type='distribute_fpn_proposals', -- GitLab