未验证 提交 6bc4f943 编写于 作者: W wangguanzhong 提交者: GitHub

fix target when fg is empty (#6937)

上级 7bd1ef4a
...@@ -340,7 +340,7 @@ def generate_mask_target(gt_segms, rois, labels_int32, sampled_gt_inds, ...@@ -340,7 +340,7 @@ def generate_mask_target(gt_segms, rois, labels_int32, sampled_gt_inds,
# generate fake roi if foreground is empty # generate fake roi if foreground is empty
if fg_inds.numel() == 0: if fg_inds.numel() == 0:
has_fg = False 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 = sampled_gt_inds[k]
inds_per_im = paddle.gather(inds_per_im, fg_inds) inds_per_im = paddle.gather(inds_per_im, fg_inds)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册