diff --git a/ppdet/modeling/proposal_generator/target.py b/ppdet/modeling/proposal_generator/target.py index 9fbc3d48634766410c7057354484617528c5d596..d4584e8a00ceb4de78bfa266b939bef51a8d6b0e 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)