tensorflow/datasets is a library of datasets ready to use with TensorFlow. The `tfds-nightly` package provides daily releases, offering the latest features and bug fixes, often before they are available in the stable `tensorflow-datasets` release. It provides a vast collection of datasets for machine learning pipelines, supporting various frameworks beyond TensorFlow, including JAX and PyTorch.
pip install tfds-nightlyVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to install `tfds-nightly`, import `tensorflow_datasets`, load a common dataset like MNIST, and iterate over a few examples. It configures a data directory and retrieves dataset information.
Regularly check the GitHub changelog and be prepared to update code to match API changes. Pin `tfds-nightly` to a specific nightly version if stability is crucial, but acknowledge that this defeats the purpose of 'nightly'.
Explicitly handle `None` values during dataset creation or consumption, e.g., by filtering, mapping, or using `tfds.features.Optional` if applicable, rather than relying on implicit defaults.
Manually install `apache-beam` if you plan to use `tfds build` or other Beam-dependent functionalities: `pip install apache-beam`. Check the `tfds` changelog or documentation for any specific version requirements for `apache-beam`.
Ensure you are on the latest `tfds-nightly` version. If encountering `ModuleNotFoundError` for platform-specific modules on non-Linux OS, check relevant GitHub issues for patches or workarounds.
Install the package: `pip install tfds-nightly` (or `pip install tensorflow-datasets` for stable). If using a virtual environment, ensure it is activated.
Inspect your dataset and data processing pipeline for `None` values. For Hugging Face datasets, be aware of the v4.9.3 change in `None` handling. Filter out `None`s, provide explicit default values, or use `tfds.features.Optional` where appropriate.
Delete the corrupted file from the `downloads` folder and try again. If the upstream data has genuinely changed, the dataset builder needs to be updated. For custom datasets, use `tfds build --register_checksums` to update the checksum.
Ensure your environment is clean and all dependencies are up-to-date (`pip install --upgrade tfds-nightly`). If the problem persists, consult the TensorFlow Datasets GitHub issues for specific workarounds or related bugs.