From 911e3517cbe94efa26e1b8d3bbb562f25f701b02 Mon Sep 17 00:00:00 2001 From: wangguanzhong Date: Wed, 14 Sep 2022 17:04:44 +0800 Subject: [PATCH] fix target when fg is empty (#6936) --- ppdet/modeling/proposal_generator/target.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppdet/modeling/proposal_generator/target.py b/ppdet/modeling/proposal_generator/target.py index 9fbc3d486..d4584e8a0 100644 --- a/ppdet/modeling/proposal_generator/target.py +++ b/ppdet/modeling/proposal_generator/target.py @@ -340,7 +340,7 @@ def generate_mask_target(gt_segms, rois, labels_int32, sampled_gt_inds, # generate fake roi if foreground is empty if fg_inds.numel() == 0: has_fg = False - fg_inds = paddle.ones([1], dtype='int32') + fg_inds = paddle.ones([1, 1], dtype='int64') inds_per_im = sampled_gt_inds[k] inds_per_im = paddle.gather(inds_per_im, fg_inds) -- GitLab