Skip to content

Commit

Permalink
Update train.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Naruto-Sasuke authored Nov 9, 2018
1 parent fe3bc52 commit 9346db4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
if opt.display_id > 0:
visualizer.plot_current_losses(epoch, float(epoch_iter) / dataset_size, opt, losses)

if opt.save_by_iter:
if total_steps % opt.save_iter_freq == 0:
print('saving model at: (iters %d)' %
(total_steps))
model.save('iter_'+str(total_steps))

if total_steps % opt.save_latest_freq == 0:
print('saving the latest model (epoch %d, total_steps %d)' %
(epoch, total_steps))
Expand Down

0 comments on commit 9346db4

Please sign in to comment.