Commit 66dd1454 authored by Derek Murray's avatar Derek Murray Committed by TensorFlower Gardener
Browse files

[tf.data] Raise an InvalidArgumentError if the argument to Dataset.list_files() matches no files.

The main effect of this change is to change a late `OutOfRangeError` at iteration time into an earlier `InvalidArgumentError` at initialization time, which will improve error reporting in Eager mode and high-level APIs that control the training loop (Estimator, Keras, etc.). This change will break some advanced uses that concatenate many potentially empty file listings, but it is possible to work around this using `tf.data.Dataset.from_tensor_slices(tf.matching_files(file_pattern))`. We expect that the improved productivity from an earlier, more actionable error message will outweigh the inconvenience of modifying a small number of existing programs.

PiperOrigin-RevId: 207344116
parent 3229c87b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment