From 04a0a6f6094dfae88cf04a4b2c5e0819e8665acc Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 5 Jan 2020 12:50:58 -0800 Subject: [PATCH] updates --- train.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/train.py b/train.py index 48d8c041..8baf79da 100644 --- a/train.py +++ b/train.py @@ -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