updates
This commit is contained in:
parent
ebe27544eb
commit
d602aed1d8
|
@ -132,7 +132,7 @@ class YOLOLayer(nn.Module):
|
||||||
if targets is not None:
|
if targets is not None:
|
||||||
BCEWithLogitsLoss = nn.BCEWithLogitsLoss()
|
BCEWithLogitsLoss = nn.BCEWithLogitsLoss()
|
||||||
MSELoss = nn.MSELoss() # version 0.4.0
|
MSELoss = nn.MSELoss() # version 0.4.0
|
||||||
# CrossEntropyLoss = nn.CrossEntropyLoss()
|
CrossEntropyLoss = nn.CrossEntropyLoss()
|
||||||
|
|
||||||
if requestPrecision:
|
if requestPrecision:
|
||||||
gx = self.grid_x[:, :, :nG, :nG]
|
gx = self.grid_x[:, :, :nG, :nG]
|
||||||
|
@ -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 = 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])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue