Skip to content

Commit 2f0e2f3

Browse files
marcenacpThe TensorFlow Datasets Authors
authored andcommitted
Better error message to pinpoint already prepared datasets in the wrong format.
PiperOrigin-RevId: 655586730
1 parent a099c59 commit 2f0e2f3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tensorflow_datasets/core/dataset_builder.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -828,9 +828,12 @@ def as_data_source(
828828
[f.value for f in random_access_formats]
829829
)
830830
unsupported_format_msg = (
831-
f"Random access data source for file format {info.file_format} is"
832-
" not supported. Can you try to run download_and_prepare with"
833-
f" file_format set to one of: {random_access_formats_msg}?"
831+
f"Random access data source for file format {info.file_format} is not"
832+
" supported. Possible root causes:\n\t* You have to run"
833+
" download_and_prepare with"
834+
f" file_format={random_access_formats_msg}.\n\t* The dataset is already"
835+
f" prepared at {self.data_dir} in the {info.file_format} format. Either"
836+
" choose another data_dir or delete the data."
834837
)
835838

836839
if info.file_format is None and not info.alternative_file_formats:

0 commit comments

Comments
 (0)