未验证 提交 5164dfd2 编写于 作者: W wangxinxin08 提交者: GitHub

fix icafe 21567: DIoULossYolo passing parameters problem (#2159)

上级 164fa063
......@@ -54,7 +54,8 @@ class DiouLossYolo(IouLoss):
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
......
......@@ -180,9 +180,19 @@ class YOLOv3Loss(object):
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))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册