diff --git a/python/paddle/fluid/tests/unittests/test_yolov3_loss_op.py b/python/paddle/fluid/tests/unittests/test_yolov3_loss_op.py index 1ec1d1527e178a35fba5a2b949191f72e0a7726b..3f0e4f7a4002a29a2f3f17915392b13fdb342677 100644 --- a/python/paddle/fluid/tests/unittests/test_yolov3_loss_op.py +++ b/python/paddle/fluid/tests/unittests/test_yolov3_loss_op.py @@ -305,6 +305,7 @@ class TestYolov3LossDygraph(unittest.TestCase): use_label_smooth=True, scale_x_y=1.) assert loss is not None + assert loss.shape == [2] paddle.enable_static() diff --git a/python/paddle/vision/ops.py b/python/paddle/vision/ops.py index 03060e92bdb69b1ec6022d887d01c514cb11b45d..4983ca49ac32fb7806959349dc4efa6e27116456 100644 --- a/python/paddle/vision/ops.py +++ b/python/paddle/vision/ops.py @@ -195,7 +195,7 @@ def yolo_loss(x, """ if in_dygraph_mode() and gt_score is None: - loss = _C_ops.yolov3_loss( + loss, _, _ = _C_ops.yolov3_loss( x, gt_box, gt_label, 'anchors', anchors, 'anchor_mask', anchor_mask, 'class_num', class_num, 'ignore_thresh', ignore_thresh, 'downsample_ratio', downsample_ratio, 'use_label_smooth',