diff --git a/ppdet/modeling/losses/diou_loss_yolo.py b/ppdet/modeling/losses/diou_loss_yolo.py index d85154d085e0f7873f86e87f031320db9f16b724..9d83eecde5e9bd67a149fa21dfec194c432e3f97 100644 --- a/ppdet/modeling/losses/diou_loss_yolo.py +++ b/ppdet/modeling/losses/diou_loss_yolo.py @@ -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 diff --git a/ppdet/modeling/losses/yolo_loss.py b/ppdet/modeling/losses/yolo_loss.py index 9445f6a231ee9eabc6e8a54fab07c5b6e0128a0a..c16c6cb11b1c6f0d5925fd68955c94b4f9e07dbf 100644 --- a/ppdet/modeling/losses/yolo_loss.py +++ b/ppdet/modeling/losses/yolo_loss.py @@ -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))