Commit 63a72e48 authored by Guillaume HEUSCH's avatar Guillaume HEUSCH

[trainer] fixed the minimum amount of sampling, remove intermediate loss files

parent f287cf90
......@@ -132,7 +132,7 @@ class DRGANTrainer(object):
# be sure to save samples at each epoch at least
if save_sample < len(dataloader):
if save_sample >= len(dataloader):
save_sample = len(dataloader) - 1
# labels for real/fake
......@@ -349,7 +349,14 @@ class DRGANTrainer(object):
f =, 'w')
f.set('d_loss', discriminator_loss)
f.set('g_loss', generator_loss)
del f
# remove the previous one(s)
import glob, os
losses_files = glob.glob(logdir + '/losses_*')
for loss_file in losses_files:
if loss_file != filename:
# save generated images at every epoch
# TODO: model moved to CPU and back and I don't really know why (expected CPU tensor error)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment