From d3a66fc61616bc028bb2f92ccc24a9364b3b5650 Mon Sep 17 00:00:00 2001 From: jerrywgz Date: Mon, 22 Apr 2019 04:08:23 +0000 Subject: [PATCH] enhance generate proposal labels, test=develop --- .../fluid/operators/detection/generate_proposal_labels_op.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/paddle/fluid/operators/detection/generate_proposal_labels_op.cc b/paddle/fluid/operators/detection/generate_proposal_labels_op.cc index 5b2e571baf3..b9b8a5a53ae 100644 --- a/paddle/fluid/operators/detection/generate_proposal_labels_op.cc +++ b/paddle/fluid/operators/detection/generate_proposal_labels_op.cc @@ -394,6 +394,10 @@ class GenerateProposalLabelsKernel : public framework::OpKernel { auto is_crowd_lod = is_crowd->lod().back(); auto gt_boxes_lod = gt_boxes->lod().back(); for (int i = 0; i < n; ++i) { + if (rpn_rois_lod[i] == rpn_rois_lod[i + 1]) { + lod0.emplace_back(num_rois); + continue; + } Tensor rpn_rois_slice = rpn_rois->Slice(rpn_rois_lod[i], rpn_rois_lod[i + 1]); Tensor gt_classes_slice = -- GitLab