diff --git a/ppdet/modeling/losses/yolo_loss.py b/ppdet/modeling/losses/yolo_loss.py index 6777608f7997dbc9a48a548b3a0ea1d2a720c0e5..92f00c5a545bb2b13fc9614ae92fb99bee0420cf 100644 --- a/ppdet/modeling/losses/yolo_loss.py +++ b/ppdet/modeling/losses/yolo_loss.py @@ -117,7 +117,8 @@ class YOLOv3Loss(object): for i, (output, target, anchors) in enumerate(zip(outputs, targets, mask_anchors)): an_num = len(anchors) // 2 - ioup, output = self._split_ioup(output, an_num, num_classes) + if self._iou_aware_loss is not None: + ioup, output = self._split_ioup(output, an_num, num_classes) x, y, w, h, obj, cls = self._split_output(output, an_num, num_classes) tx, ty, tw, th, tscale, tobj, tcls = self._split_target(target)