This commit is contained in:
Glenn Jocher 2018-08-26 21:59:55 +02:00
parent d602aed1d8
commit d378e32803
1 changed files with 2 additions and 2 deletions

View File

@ -159,8 +159,8 @@ class YOLOLayer(nn.Module):
lh = 5 * MSELoss(h[mask], th[mask]) lh = 5 * MSELoss(h[mask], th[mask])
lconf = 1.5 * BCEWithLogitsLoss(pred_conf[mask], mask[mask].float()) lconf = 1.5 * BCEWithLogitsLoss(pred_conf[mask], mask[mask].float())
lcls = CrossEntropyLoss(pred_cls[mask], torch.argmax(tcls, 1)) # lcls = CrossEntropyLoss(pred_cls[mask], torch.argmax(tcls, 1))
# lcls = BCEWithLogitsLoss(pred_cls[mask], tcls.float()) lcls = 10 * BCEWithLogitsLoss(pred_cls[mask], tcls.float())
else: else:
lx, ly, lw, lh, lcls, lconf = FT([0]), FT([0]), FT([0]), FT([0]), FT([0]), FT([0]) lx, ly, lw, lh, lcls, lconf = FT([0]), FT([0]), FT([0]), FT([0]), FT([0]), FT([0])