diff options
Diffstat (limited to 'inversion/image_inversion.py')
| -rw-r--r-- | inversion/image_inversion.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/inversion/image_inversion.py b/inversion/image_inversion.py index 76638f9..38c5261 100644 --- a/inversion/image_inversion.py +++ b/inversion/image_inversion.py @@ -321,12 +321,14 @@ if params.dataset.endswith('.hdf5'): i_1, i_2 = i*BATCH_SIZE, (i+1)*BATCH_SIZE yield sample_latents[i_1:i_2] latent_gen = sample_latent_gen() + if NUM_IMGS % BATCH_SIZE != 0: + REMAINDER = BATCH_SIZE - (NUM_IMGS % BATCH_SIZE) + sample_images = sample_images.append(sample_images[-REMAINDER]) + sample_labels = sample_labels.append(sample_labels[-REMAINDER]) assert(NUM_IMGS % BATCH_SIZE == 0) else: sys.exit('Unknown dataset {}.'.format(params.dataset)) -NUM_IMGS -= NUM_IMGS % BATCH_SIZE - # -------------------------- # Training. # -------------------------- |
