From c3b96395060cfb377aeaa8814a34e55831ccb0d3 Mon Sep 17 00:00:00 2001 From: Kaipeng Deng Date: Tue, 22 Sep 2020 13:18:27 +0800 Subject: [PATCH] add batch_size in YOLOv3Loss for backward compatable. (#1469) * add batch_size in YOLOv3Loss for backward compatable. --- ppdet/modeling/losses/yolo_loss.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/ppdet/modeling/losses/yolo_loss.py b/ppdet/modeling/losses/yolo_loss.py index e978eb992..2860e7a34 100644 --- a/ppdet/modeling/losses/yolo_loss.py +++ b/ppdet/modeling/losses/yolo_loss.py @@ -41,16 +41,18 @@ class YOLOv3Loss(object): __inject__ = ['iou_loss', 'iou_aware_loss'] __shared__ = ['use_fine_grained_loss', 'train_batch_size'] - def __init__(self, - train_batch_size=8, - ignore_thresh=0.7, - label_smooth=True, - use_fine_grained_loss=False, - iou_loss=None, - iou_aware_loss=None, - downsample=[32, 16, 8], - scale_x_y=1., - match_score=False): + def __init__( + self, + train_batch_size=8, + batch_size=8, # stub for backward compatable + ignore_thresh=0.7, + label_smooth=True, + use_fine_grained_loss=False, + iou_loss=None, + iou_aware_loss=None, + downsample=[32, 16, 8], + scale_x_y=1., + match_score=False): self._train_batch_size = train_batch_size self._ignore_thresh = ignore_thresh self._label_smooth = label_smooth -- GitLab