diff --git a/ppdet/modeling/losses/yolo_loss.py b/ppdet/modeling/losses/yolo_loss.py index 2860e7a342abf12006e098d0749995aebaf048f0..9445f6a231ee9eabc6e8a54fab07c5b6e0128a0a 100644 --- a/ppdet/modeling/losses/yolo_loss.py +++ b/ppdet/modeling/losses/yolo_loss.py @@ -23,6 +23,9 @@ try: except Exception: from collections import Sequence +import logging +logger = logging.getLogger(__name__) + __all__ = ['YOLOv3Loss'] @@ -44,7 +47,7 @@ class YOLOv3Loss(object): def __init__( self, train_batch_size=8, - batch_size=8, # stub for backward compatable + batch_size=-1, # stub for backward compatable ignore_thresh=0.7, label_smooth=True, use_fine_grained_loss=False, @@ -63,6 +66,11 @@ class YOLOv3Loss(object): self.scale_x_y = scale_x_y self.match_score = match_score + if batch_size != -1: + logger.warn( + "config YOLOv3Loss.batch_size is deprecated, " + "training batch size should be set by TrainReader.batch_size") + def __call__(self, outputs, gt_box, gt_label, gt_score, targets, anchors, anchor_masks, mask_anchors, num_classes, prefix_name): if self._use_fine_grained_loss: