datasets

tensorflowApache-2.0活跃维护

提供大量可直接用于 TensorFlow、JAX 等框架的数据集集合,省去自己下载、解析和预处理数据的麻烦,统一接口加载即可训练模型。

TFDS is a collection of datasets ready to use with TensorFlow, Jax, ...

v4.9.10发布于 2026-05-08 13:32 UTC4,611star1,596fork同步于 2026-11-11 05:35 UTC

怎么上手

由 README 提炼,执行前请确认
pip install tensorflow-datasets
硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

把大量公开数据集封装成 tf.data.Dataset,省去下载和预处理

提供大量可直接用于 TensorFlow、JAX 等框架的数据集集合,省去自己下载、解析和预处理数据的麻烦,统一接口加载即可训练模型。

核心能力

  • 用 tfds.load 一行加载公开数据集并指定 split
  • 输出标准 tf.data.Dataset,可直接接 shuffle/batch/prefetch 流水线
  • 保证同一用户得到相同顺序的样本,便于复现
  • 支持自定义数据集,按官方指南即可添加
  • 同时面向 TensorFlow 与 Jax 使用

容易踩的坑

首次加载会联网下载数据集,需保证网络与磁盘空间;使用前需自行确认数据集许可证与可用性;README 标注需要 Python 3.11+

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v4.9.10
  1. v4.9.10最新正式版2026-05-08 · 2026-05-08 13:32 UTC

    这个版本没有写更新说明。

  2. v4.9.92025-05-28 · 2025-05-28 13:38 UTC
    查看更新说明

    Added

    Changed

    • apache-beam version is pinned at <2.65.0 until related tests are fixed, see issue 11055.

    Deprecated

    Removed

    Fixed

    • CroissantBuilder now supports Croissant files without patch version (i.e. only {major.minor} are provided).
    • Various small bug fixes.

    Security

  3. v4.9.82025-03-12 · 2025-03-12 16:04 UTC
    查看更新说明

    Added

    • New Beam writer NoShuffleBeamWriter that doesn't shuffle, which speeds up dataset generation significantly, but does not have deterministic order guarantees. Can be enabled with the flag --nondeterministic_order.
    • CroissantBuilder now supports Croissant files that define splits; and new feature types: feature dictionaries and multidimensional arrays.
    • New datasets.

    Changed

    Deprecated

    Removed

    Fixed

    • Various small bug fixes.
    • Various performance improvements.

    Security

  4. v4.9.72024-10-30 · 2024-10-30 12:58 UTC
    查看更新说明

    Added

    • New datasets.

    Changed

    • CroissantBuilder's API to generate TFDS datasets from Croissant files.

    Deprecated

    Removed

    Fixed

    • Versions for existing datasets.

    Security

  5. v4.9.62024-06-05 · 2024-06-05 08:15 UTC
    查看更新说明

    Added

    • Full support for Python 3.12.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    TensorFlow Datasets

    TensorFlow Datasets provides many public datasets as tf.data.Datasets.

    Unittests PyPI version Python 3.11+ Tutorial API Catalog

    Documentation

    To install and use TFDS, we strongly encourage to start with our getting started guide. Try it interactively in a Colab notebook.

    Our documentation contains:

    # !pip install tensorflow-datasets
    import tensorflow_datasets as tfds
    import tensorflow as tf
    
    # Construct a tf.data.Dataset
    ds = tfds.load('mnist', split='train', as_supervised=True, shuffle_files=True)
    
    # Build your input pipeline
    ds = ds.shuffle(1000).batch(128).prefetch(10).take(5)
    for image, label in ds:
      pass
    

    TFDS core values

    TFDS has been built with these principles in mind:

    • Simplicity: Standard use-cases should work out-of-the box
    • Performance: TFDS follows best practices and can achieve state-of-the-art speed
    • Determinism/reproducibility: All users get the same examples in the same order
    • Customisability: Advanced users can have fine-grained control

    If those use cases are not satisfied, please send us feedback.

    Want a certain dataset?

    Adding a dataset is really straightforward by following our guide.

    Request a dataset by opening a Dataset request GitHub issue.

    And vote on the current set of requests by adding a thumbs-up reaction to the issue.

    Citation

    Please include the following citation when using tensorflow-datasets for a paper, in addition to any citation specific to the used datasets.

    @misc{TFDS,
      title = {{TensorFlow Datasets}, A collection of ready-to-use datasets},
      howpublished = {\url{https://www.tensorflow.org/datasets}},
    }
    
    Disclaimers

    This is a utility library that downloads and prepares public datasets. We do not host or distribute these datasets, vouch for their quality or fairness, or claim that you have license to use the dataset. It is your responsibility to determine whether you have permission to use the dataset under the dataset's license.

    If you're a dataset owner and wish to update any part of it (description, citation, etc.), or do not want your dataset to be included in this library, please get in touch through a GitHub issue. Thanks for your contribution to the ML community!

    If you're interested in learning more about responsible AI practices, including fairness, please see Google AI's Responsible AI Practices.

    tensorflow/datasets is Apache 2.0 licensed. See the LICENSE file.