This commit is contained in:
Glenn Jocher 2020-01-21 16:18:24 -08:00
parent 20e381edb4
commit 6ccf19038d
1 changed files with 4 additions and 3 deletions

View File

@ -365,8 +365,8 @@ def train():
torch.save(chkpt, best) torch.save(chkpt, best)
# Save backup every 10 epochs (optional) # Save backup every 10 epochs (optional)
if epoch > 0 and epoch % 10 == 0: # if epoch > 0 and epoch % 10 == 0:
torch.save(chkpt, wdir + 'backup%g.pt' % epoch) # torch.save(chkpt, wdir + 'backup%g.pt' % epoch)
# Delete checkpoint # Delete checkpoint
del chkpt del chkpt
@ -384,7 +384,8 @@ def train():
# save to cloud # save to cloud
if opt.bucket: if opt.bucket:
os.system('gsutil cp %s %s gs://%s' % (fresults, wdir + flast, opt.bucket)) os.system('gsutil cp %s gs://%s/results' % (fresults, opt.bucket))
os.system('gsutil cp %s gs://%s/weights' % (wdir + flast, opt.bucket))
if not opt.evolve: if not opt.evolve:
plot_results() # save as results.png plot_results() # save as results.png