提交 23d2bde0 authored 作者: Glenn Jocher's avatar Glenn Jocher

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

上级 bcd452c4
...@@ -493,7 +493,8 @@ def compute_loss(p, targets, model): # predictions, targets, model ...@@ -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
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论