This commit is contained in:
Glenn Jocher 2019-12-30 15:41:47 -08:00
parent d30e4eea37
commit 9dd1316a70
1 changed files with 2 additions and 1 deletions

View File

@ -435,8 +435,9 @@ def compute_loss(p, targets, model): # predictions, targets, model
lobj *= h['obj'] lobj *= h['obj']
lcls *= h['cls'] lcls *= h['cls']
if red == 'sum': if red == 'sum':
bs = tobj.shape[0] # batch size
lbox *= 3 / ng lbox *= 3 / ng
lobj *= 3 / np * 2 lobj *= 3 / (6300 * bs) * 2 # 3 / np * 2
lcls *= 3 / ng / model.nc lcls *= 3 / ng / model.nc
loss = lbox + lobj + lcls loss = lbox + lobj + lcls