Skip to content

Commit fecbb15

Browse files
Ryan Sepassicopybara-github
authored andcommitted
Add warning for shuffle_files
PiperOrigin-RevId: 257099648
1 parent 601cc99 commit fecbb15

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

tensorflow_datasets/core/dataset_builder.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,14 @@ def _build_single_dataset(self, split, shuffle_files, batch_size,
379379

380380
if shuffle_files is None:
381381
# Shuffle files if training
382-
shuffle_files = split == splits_lib.Split.TRAIN
382+
if split == splits_lib.Split.TRAIN:
383+
logging.warning(
384+
"Warning: Setting shuffle_files=True because split=TRAIN and "
385+
"shuffle_files=None. This behavior will be deprecated on "
386+
"2019-08-06, "
387+
"at which point shuffle_files=False will be the default for all "
388+
"splits.")
389+
shuffle_files = True
383390

384391
wants_full_dataset = batch_size == -1
385392
if wants_full_dataset:
@@ -409,10 +416,10 @@ def _build_single_dataset(self, split, shuffle_files, batch_size,
409416
# to do by using a requested version of tf.data.Dataset.cache that can
410417
# persist a cache beyond iterator instances.
411418
if not dataset_shape_is_fully_defined:
412-
tf.logging.warning("Called in_memory=True on a dataset that does not "
413-
"have fully defined shapes. Note that features with "
414-
"variable length dimensions will be 0-padded to "
415-
"the maximum length across the dataset.")
419+
logging.warning("Called in_memory=True on a dataset that does not "
420+
"have fully defined shapes. Note that features with "
421+
"variable length dimensions will be 0-padded to "
422+
"the maximum length across the dataset.")
416423
full_bs = self.info.splits.total_num_examples or sys.maxsize
417424
# If using in_memory, escape all device contexts so we can load the data
418425
# with a local Session.

0 commit comments

Comments
 (0)