leaf variable --single-cls training bug fix (#593)
This commit is contained in:
1 parent
bcd452c482
commit
23d2bde01f
1 file changed
+2
-1
+2
-1
@@ -493,7 +493,8 @@ def compute_loss(p, targets, model): # predictions, targets, model
|
|||||||
s = 3 / np # output count scaling
|
s = 3 / np # output count scaling
|
||||||
lbox *= h['giou'] * s
|
lbox *= h['giou'] * s
|
||||||
lobj *= h['obj'] * s * (1.4 if np == 4 else 1.)
|
lobj *= h['obj'] * s * (1.4 if np == 4 else 1.)
|
||||||
lcls *= h['cls'] * s
|
if model.nc > 1:
|
||||||
|
lcls *= h['cls'] * s
|
||||||
bs = tobj.shape[0] # batch size
|
bs = tobj.shape[0] # batch size
|
||||||
|
|
||||||
loss = lbox + lobj + lcls
|
loss = lbox + lobj + lcls
|
||||||
|
|||||||
Reference in new issue
Block a user