Skip to content

Commit 47013af

Browse files
authored
Merge pull request PaddlePaddle#17011 from jerrywgz/enhance_generate_proposal_labels
enhance generate proposal labels, test=develop
2 parents 7c370e4 + d3a66fc commit 47013af

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

paddle/fluid/operators/detection/generate_proposal_labels_op.cc

+4
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,10 @@ class GenerateProposalLabelsKernel : public framework::OpKernel<T> {
394394
auto is_crowd_lod = is_crowd->lod().back();
395395
auto gt_boxes_lod = gt_boxes->lod().back();
396396
for (int i = 0; i < n; ++i) {
397+
if (rpn_rois_lod[i] == rpn_rois_lod[i + 1]) {
398+
lod0.emplace_back(num_rois);
399+
continue;
400+
}
397401
Tensor rpn_rois_slice =
398402
rpn_rois->Slice(rpn_rois_lod[i], rpn_rois_lod[i + 1]);
399403
Tensor gt_classes_slice =

0 commit comments

Comments
 (0)