leaf variable --single-cls training bug fix (#593)

pull/1/head
Glenn Jocher 5 years ago
parent bcd452c482
commit 23d2bde01f

@ -493,6 +493,7 @@ def compute_loss(p, targets, model): # predictions, targets, model
s = 3 / np # output count scaling
lbox *= h['giou'] * s
lobj *= h['obj'] * s * (1.4 if np == 4 else 1.)
if model.nc > 1:
lcls *= h['cls'] * s
bs = tobj.shape[0] # batch size

Loading…
Cancel
Save