Merge branch 'master' of https://github.com/ultralytics/yolov5
commit
69c0d2da8a
6
train.py
6
train.py
|
@ -336,9 +336,8 @@ def train(hyp):
|
||||||
# end epoch ----------------------------------------------------------------------------------------------------
|
# end epoch ----------------------------------------------------------------------------------------------------
|
||||||
# end training
|
# end training
|
||||||
|
|
||||||
n = opt.name
|
# Strip optimizers
|
||||||
if len(n):
|
n = ('_' if len(opt.name) and not opt.name.isnumeric() else '') + opt.name
|
||||||
n = '_' + n if not n.isnumeric() else n
|
|
||||||
fresults, flast, fbest = 'results%s.txt' % n, wdir + 'last%s.pt' % n, wdir + 'best%s.pt' % n
|
fresults, flast, fbest = 'results%s.txt' % n, wdir + 'last%s.pt' % n, wdir + 'best%s.pt' % n
|
||||||
for f1, f2 in zip([wdir + 'last.pt', wdir + 'best.pt', 'results.txt'], [flast, fbest, fresults]):
|
for f1, f2 in zip([wdir + 'last.pt', wdir + 'best.pt', 'results.txt'], [flast, fbest, fresults]):
|
||||||
if os.path.exists(f1):
|
if os.path.exists(f1):
|
||||||
|
@ -347,6 +346,7 @@ def train(hyp):
|
||||||
strip_optimizer(f2) if ispt else None # strip optimizer
|
strip_optimizer(f2) if ispt else None # strip optimizer
|
||||||
os.system('gsutil cp %s gs://%s/weights' % (f2, opt.bucket)) if opt.bucket and ispt else None # upload
|
os.system('gsutil cp %s gs://%s/weights' % (f2, opt.bucket)) if opt.bucket and ispt else None # upload
|
||||||
|
|
||||||
|
# Finish
|
||||||
if not opt.evolve:
|
if not opt.evolve:
|
||||||
plot_results() # save as results.png
|
plot_results() # save as results.png
|
||||||
print('%g epochs completed in %.3f hours.\n' % (epoch - start_epoch + 1, (time.time() - t0) / 3600))
|
print('%g epochs completed in %.3f hours.\n' % (epoch - start_epoch + 1, (time.time() - t0) / 3600))
|
||||||
|
|
Loading…
Reference in New Issue