TensorFlow 데이터 세트: 바로 사용할 수 있는 데이터 세트 컬렉션

TensorFlow Datasets는 TensorFlow 또는 Jax와 같은 다른 Python ML 프레임워크와 함께 사용할 준비가 된 데이터 세트 컬렉션입니다. 모든 데이터세트는 tf.data.Datasets로 노출되므로 사용이 간편한 고성능 입력 파이프라인이 가능합니다. 시작하려면 가이드데이터세트 목록을 참조하세요.
import tensorflow.compat.v2 as tf
import tensorflow_datasets as tfds

# Construct a tf.data.Dataset
ds = tfds.load('mnist', split='train', shuffle_files=True)

# Build your input pipeline
ds = ds.shuffle(1024).batch(32).prefetch(tf.data.experimental.AUTOTUNE)
for example in ds.take(1):
  image, label = example["image"], example["label"]
노트북에서 실행