From 0cf88f046d1a00f92850566d13fa837edfb09c02 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 12 May 2020 09:53:13 -0700 Subject: [PATCH] hyp evolution bug fix #1160 --- train.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/train.py b/train.py index 1c70e193..0f4997e1 100644 --- a/train.py +++ b/train.py @@ -54,7 +54,7 @@ if hyp['fl_gamma']: print('Using FocalLoss(gamma=%g)' % hyp['fl_gamma']) -def train(): +def train(hyp): cfg = opt.cfg data = opt.data epochs = opt.epochs # 500200 batches at bs 64, 117263 images = 273 epochs @@ -409,7 +409,7 @@ if __name__ == '__main__': if not opt.evolve: # Train normally print('Start Tensorboard with "tensorboard --logdir=runs", view at http://localhost:6006/') tb_writer = SummaryWriter(comment=opt.name) - train() # train normally + train(hyp) # train normally else: # Evolve hyperparameters (optional) opt.notest, opt.nosave = True, True # only test/save final epoch @@ -455,7 +455,7 @@ if __name__ == '__main__': hyp[k] = np.clip(hyp[k], v[0], v[1]) # Train mutation - results = train() + results = train(hyp.copy()) # Write mutation results print_mutation(hyp, results, opt.bucket)