Skip to content

Commit 576f52c

Browse files
authored
fix no label training in bs=2 (#4977)
1 parent a2f2476 commit 576f52c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ppdet/modeling/proposal_generator/target.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ def rpn_anchor_target(anchors,
5050
labels = paddle.scatter(labels, fg_inds, paddle.ones_like(fg_inds))
5151
# Step3: make output
5252
if gt_bbox.shape[0] == 0:
53-
matched_gt_boxes = paddle.zeros([0, 4])
54-
tgt_delta = paddle.zeros([0, 4])
53+
matched_gt_boxes = paddle.zeros([matches.shape[0], 4])
54+
tgt_delta = paddle.zeros([matches.shape[0], 4])
5555
else:
5656
matched_gt_boxes = paddle.gather(gt_bbox, matches)
5757
tgt_delta = bbox2delta(anchors, matched_gt_boxes, weights)

0 commit comments

Comments
 (0)