From 646a21a5cd1c23658d0de956fd2fd0bbf4ba7614 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 21 Feb 2019 10:57:55 +0100 Subject: [PATCH] updates --- models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/models.py b/models.py index 204cc990..e6832ab5 100755 --- a/models.py +++ b/models.py @@ -159,7 +159,8 @@ class YOLOLayer(nn.Module): # Compute losses nT = sum([len(x) for x in targets]) # number of targets nM = mask.sum().float() # number of anchors (assigned to targets) - k = nM / bs + k = 1 #nM / bs + if nM > 0: lxy = k * MSELoss(xy[mask], txy[mask]) lwh = k * MSELoss(wh[mask], twh[mask])