v2.0 Release (#491)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
1 parent
5e970d45c4
commit
9da56b62dd
9 files changed
+77
-86
No files matched your search
@@ -27,16 +27,16 @@ hyp = {'optimizer': 'SGD', # ['adam', 'SGD', None] if none, default is SGD
|
||||
'momentum': 0.937, # SGD momentum/Adam beta1
|
||||
'weight_decay': 5e-4, # optimizer weight decay
|
||||
'giou': 0.05, # giou loss gain
|
||||
'cls': 0.58, # cls loss gain
|
||||
'cls': 0.5, # cls loss gain
|
||||
'cls_pw': 1.0, # cls BCELoss positive_weight
|
||||
'obj': 1.0, # obj loss gain (*=img_size/320 if img_size != 320)
|
||||
'obj_pw': 1.0, # obj BCELoss positive_weight
|
||||
'iou_t': 0.20, # iou training threshold
|
||||
'anchor_t': 4.0, # anchor-multiple threshold
|
||||
'fl_gamma': 0.0, # focal loss gamma (efficientDet default is gamma=1.5)
|
||||
'hsv_h': 0.014, # image HSV-Hue augmentation (fraction)
|
||||
'hsv_s': 0.68, # image HSV-Saturation augmentation (fraction)
|
||||
'hsv_v': 0.36, # image HSV-Value augmentation (fraction)
|
||||
'hsv_h': 0.015, # image HSV-Hue augmentation (fraction)
|
||||
'hsv_s': 0.7, # image HSV-Saturation augmentation (fraction)
|
||||
'hsv_v': 0.4, # image HSV-Value augmentation (fraction)
|
||||
'degrees': 0.0, # image rotation (+/- deg)
|
||||
'translate': 0.0, # image translation (+/- fraction)
|
||||
'scale': 0.5, # image scale (+/- gain)
|
||||
@@ -159,7 +159,7 @@ def train(hyp, tb_writer, opt, device):
|
||||
model, optimizer = amp.initialize(model, optimizer, opt_level='O1', verbosity=0)
|
||||
|
||||
# Scheduler https://arxiv.org/pdf/1812.01187.pdf
|
||||
lf = lambda x: (((1 + math.cos(x * math.pi / epochs)) / 2) ** 1.0) * 0.9 + 0.1 # cosine
|
||||
lf = lambda x: (((1 + math.cos(x * math.pi / epochs)) / 2) ** 1.0) * 0.8 + 0.2 # cosine
|
||||
scheduler = lr_scheduler.LambdaLR(optimizer, lr_lambda=lf)
|
||||
# https://discuss.pytorch.org/t/a-problem-occured-when-resuming-an-optimizer/28822
|
||||
# plot_lr_scheduler(optimizer, scheduler, epochs)
|
||||
@@ -334,7 +334,7 @@ def train(hyp, tb_writer, opt, device):
|
||||
if rank in [-1, 0]:
|
||||
# mAP
|
||||
if ema is not None:
|
||||
ema.update_attr(model, include=['md', 'nc', 'hyp', 'gr', 'names', 'stride'])
|
||||
ema.update_attr(model, include=['yaml', 'nc', 'hyp', 'gr', 'names', 'stride'])
|
||||
final_epoch = epoch + 1 == epochs
|
||||
if not opt.notest or final_epoch: # Calculate mAP
|
||||
results, maps, times = test.test(opt.data,
|
||||
|
||||
Reference in new issue
Block a user