Skip to content

Commit

Permalink
fix icafe 21567: DIoULossYolo passing parameters problem (PaddlePaddl…
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxinxin08 authored Feb 20, 2021
1 parent 164fa06 commit 5164dfd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ppdet/modeling/losses/diou_loss_yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def __call__(self,
anchors,
downsample_ratio,
batch_size,
eps=1.e-10):
eps=1.e-10,
**kwargs):
'''
Args:
x | y | w | h ([Variables]): the output of yolov3 for encoded x|y|w|h
Expand Down
16 changes: 13 additions & 3 deletions ppdet/modeling/losses/yolo_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,19 @@ def _get_fine_grained_loss(self,
loss_h = fluid.layers.abs(h - th) * tscale_tobj
loss_h = fluid.layers.reduce_sum(loss_h, dim=[1, 2, 3])
if self._iou_loss is not None:
loss_iou = self._iou_loss(x, y, w, h, tx, ty, tw, th, anchors,
downsample, self._train_batch_size,
scale_x_y)
loss_iou = self._iou_loss(
x,
y,
w,
h,
tx,
ty,
tw,
th,
anchors,
downsample,
self._train_batch_size,
scale_x_y=scale_x_y)
loss_iou = loss_iou * tscale_tobj
loss_iou = fluid.layers.reduce_sum(loss_iou, dim=[1, 2, 3])
loss_ious.append(fluid.layers.reduce_mean(loss_iou))
Expand Down

0 comments on commit 5164dfd

Please sign in to comment.