Fixed slicing

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
2019-04-10 15:16:13 +02:00
parent f30edeb3f2
commit f81ecbac0d

View File

@ -171,7 +171,7 @@ def _train_one_epoch_simple(epoch: int,
enc_dec_loss_avg(reconstruction_loss) enc_dec_loss_avg(reconstruction_loss)
if int(global_step % LOG_FREQUENCY) == 0: if int(global_step % LOG_FREQUENCY) == 0:
comparison = K.concatenate([x[:batch_size/2], x_decoded[:batch_size/2]], axis=0) comparison = K.concatenate([x[:int(batch_size / 2)], x_decoded[:int(batch_size / 2)]], axis=0)
grid = util.prepare_image(comparison.cpu(), nrow=int(batch_size/2)) grid = util.prepare_image(comparison.cpu(), nrow=int(batch_size/2))
summary_ops_v2.image(name='reconstruction', summary_ops_v2.image(name='reconstruction',
tensor=K.expand_dims(grid, axis=0), max_images=1, tensor=K.expand_dims(grid, axis=0), max_images=1,