Commit d724a08b authored by Zhichao Lu's avatar Zhichao Lu Committed by pkulzc
Browse files

Add warning if shuffle=false but num_readers > 1. The latter would cause the...

Add warning if shuffle=false but num_readers > 1. The latter would cause the input data stream to still be shuffled.

PiperOrigin-RevId: 190678792
parent 952dd997
...@@ -123,6 +123,10 @@ def read_dataset(file_read_func, decode_func, input_files, config): ...@@ -123,6 +123,10 @@ def read_dataset(file_read_func, decode_func, input_files, config):
if config.shuffle: if config.shuffle:
filename_dataset = filename_dataset.shuffle( filename_dataset = filename_dataset.shuffle(
config.filenames_shuffle_buffer_size) config.filenames_shuffle_buffer_size)
elif config.num_readers > 1:
tf.logging.warning('`shuffle` is false, but the input data stream is '
'still slightly shuffled since `num_readers` > 1.')
filename_dataset = filename_dataset.repeat(config.num_epochs or None) filename_dataset = filename_dataset.repeat(config.num_epochs or None)
records_dataset = filename_dataset.apply( records_dataset = filename_dataset.apply(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment