diff --git a/ppdet/modeling/ops.py b/ppdet/modeling/ops.py index f4787cf7007665ec0291dd728e56ea73f678b290..4065e7d36ad2bec57b5d08978bd52276e8a74bec 100644 --- a/ppdet/modeling/ops.py +++ b/ppdet/modeling/ops.py @@ -722,7 +722,7 @@ class MultiClassDiouNMS(object): cls_boxes = np.vstack(cls_boxes[start_idx:]) cls_ids = np.vstack(cls_ids[start_idx:]) - pred_result = np.hstack([cls_ids, cls_boxes]) + pred_result = np.hstack([cls_ids, cls_boxes]).astype(np.float32) # Limit to max_per_image detections **over all classes** image_scores = cls_boxes[:, 0] @@ -743,8 +743,8 @@ class MultiClassDiouNMS(object): fluid.default_main_program(), name='diou_nms_pred_result', dtype='float32', - shape=[6], - lod_level=1) + shape=[-1, 6], + lod_level=0) fluid.layers.py_func( func=_diou_nms, x=[bboxes, scores], out=pred_result) return pred_result