Only use drop_remainder in dataset for train phase

This commit is contained in:
Reuben Morais 2020-06-08 10:47:13 +02:00
parent 80a3d70686
commit 28c7f4c35d
2 changed files with 1 additions and 2 deletions

View File

@ -61,7 +61,6 @@ def evaluate(test_csvs, create_model):
# One rate per layer
no_dropout = [None] * 6
logits, _ = create_model(batch_x=batch_x,
batch_size=FLAGS.test_batch_size,
seq_length=batch_x_len,
dropout=no_dropout)

View File

@ -151,7 +151,7 @@ def create_dataset(sources,
.map(process_fn, num_parallel_calls=tf.data.experimental.AUTOTUNE))
if enable_cache:
dataset = dataset.cache(cache_path)
dataset = (dataset.window(batch_size, drop_remainder=True).flat_map(batch_fn)
dataset = (dataset.window(batch_size, drop_remainder=train_phase).flat_map(batch_fn)
.prefetch(len(Config.available_devices)))
return dataset