This commit is contained in:
Glenn Jocher 2020-01-05 12:50:58 -08:00
parent 1aedf27886
commit 04a0a6f609
1 changed files with 4 additions and 2 deletions

View File

@ -367,8 +367,10 @@ def train():
# end epoch ----------------------------------------------------------------------------------------------------
# end training
if len(opt.name) and not opt.prebias:
fresults, flast, fbest = 'results%s.txt' % opt.name, 'last%s.pt' % opt.name, 'best%s.pt' % opt.name
n = opt.name
if len(n) and not opt.prebias:
n = '_' + n if not n.isnumeric() else n
fresults, flast, fbest = 'results%s.txt' % n, 'last%s.pt' % n, 'best%s.pt' % n
os.rename('results.txt', fresults)
os.rename(wdir + 'last.pt', wdir + flast) if os.path.exists(wdir + 'last.pt') else None
os.rename(wdir + 'best.pt', wdir + fbest) if os.path.exists(wdir + 'best.pt') else None