This commit is contained in:
Glenn Jocher 2019-12-27 20:32:01 -08:00
parent e5b5d6a880
commit 609a9d94cf
1 changed files with 1 additions and 1 deletions

View File

@ -399,7 +399,7 @@ def compute_loss(p, targets, model): # predictions, targets, model
pbox = torch.cat((pxy, pwh), 1) # predicted box
giou = bbox_iou(pbox.t(), tbox[i], x1y1x2y2=False, GIoU=True) # giou computation
lbox += (1.0 - giou).sum() if red == 'sum' else (1.0 - giou).mean() # giou loss
tobj[b, a, gj, gi] = 1.0 # giou.type(tobj.dtype) # obj
tobj[b, a, gj, gi] = 1.0 # giou.detach().type(tobj.dtype) * 0.5 + 0.5 # obj
if 'default' in arc and model.nc > 1: # cls loss (only if multiple classes)
t = torch.zeros_like(ps[:, 5:]) # targets