TFDS now supports the Croissant 🥐 format! Read the documentation to know more.

tfds.download.GenerateMode

View source on GitHub

Enum for how to treat pre-existing downloads and data.

View aliases

Main aliases

tfds.GenerateMode

The default mode is REUSE_DATASET_IF_EXISTS, which will reuse both raw downloads and the prepared dataset if they exist.

The generations modes:

Downloads Dataset Metadata
REUSE_DATASET_IF_EXISTS (default) Reuse Reuse Reuse
UPDATE_DATASET_INFO Reuse Reuse Fresh
REUSE_CACHE_IF_EXISTS Reuse Fresh Fresh
FORCE_REDOWNLOAD Fresh Fresh Fresh

UPDATE_DATASET_INFO only regenerates DatasetInfo metadata which is directly coming from the Builder metadata, and not directly used to prepare the data or computed from the downloaded or prepared data. This means that description, config_tags, etc. will be updated, but download_size, schema, splits, disable_shuffling, file_format will not be updated. UPDATE_DATASET_INFO will fail if the data has never been prepared.

Class Variables

FORCE_REDOWNLOAD <GenerateMode.FORCE_REDOWNLOAD: 'force_redownload'>
REUSE_CACHE_IF_EXISTS <GenerateMode.REUSE_CACHE_IF_EXISTS: 'reuse_cache_if_exists'>
REUSE_DATASET_IF_EXISTS <GenerateMode.REUSE_DATASET_IF_EXISTS: 'reuse_dataset_if_exists'>
UPDATE_DATASET_INFO <GenerateMode.UPDATE_DATASET_INFO: 'update_dataset_info'>

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024年04月26日 UTC.