未验证 提交 576f52cf 编写于 作者: W wangguanzhong 提交者: GitHub

fix no label training in bs=2 (#4977)

上级 a2f24762
......@@ -50,8 +50,8 @@ def rpn_anchor_target(anchors,
labels = paddle.scatter(labels, fg_inds, paddle.ones_like(fg_inds))
# Step3: make output
if gt_bbox.shape[0] == 0:
matched_gt_boxes = paddle.zeros([0, 4])
tgt_delta = paddle.zeros([0, 4])
matched_gt_boxes = paddle.zeros([matches.shape[0], 4])
tgt_delta = paddle.zeros([matches.shape[0], 4])
else:
matched_gt_boxes = paddle.gather(gt_bbox, matches)
tgt_delta = bbox2delta(anchors, matched_gt_boxes, weights)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册