This commit is contained in:
Glenn Jocher 2020-01-03 14:36:39 -08:00
parent 4fe9c90514
commit 07c40a3f14
2 changed files with 2 additions and 2 deletions

View File

@ -446,7 +446,7 @@ if __name__ == '__main__':
mixed_precision = False mixed_precision = False
# scale hyp['obj'] by img_size (evolved at 320) # scale hyp['obj'] by img_size (evolved at 320)
hyp['obj'] *= opt.img_size / 320. # hyp['obj'] *= opt.img_size / 320.
tb_writer = None tb_writer = None
if not opt.evolve: # Train normally if not opt.evolve: # Train normally

View File

@ -367,7 +367,7 @@ def compute_loss(p, targets, model): # predictions, targets, model
tcls, tbox, indices, anchor_vec = build_targets(model, targets) tcls, tbox, indices, anchor_vec = build_targets(model, targets)
h = model.hyp # hyperparameters h = model.hyp # hyperparameters
arc = model.arc # # (default, uCE, uBCE) detection architectures arc = model.arc # # (default, uCE, uBCE) detection architectures
red = 'mean' # Loss reduction (sum or mean) red = 'sum' # Loss reduction (sum or mean)
# Define criteria # Define criteria
BCEcls = nn.BCEWithLogitsLoss(pos_weight=ft([h['cls_pw']]), reduction=red) BCEcls = nn.BCEWithLogitsLoss(pos_weight=ft([h['cls_pw']]), reduction=red)