Skip to content

Commit

Permalink
fix yolov3 return value in dygraph mode. test=develop (#40185)
Browse files Browse the repository at this point in the history
  • Loading branch information
heavengate committed Mar 8, 2022
1 parent 2ce007c commit 9aa6bfc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions python/paddle/fluid/tests/unittests/test_yolov3_loss_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ def test_dygraph(self):
use_label_smooth=True,
scale_x_y=1.)
assert loss is not None
assert loss.shape == [2]
paddle.enable_static()


Expand Down
2 changes: 1 addition & 1 deletion python/paddle/vision/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 9aa6bfc

Please sign in to comment.