Skip to content

Latest commit

History

History
200 lines (192 loc) 路 7.52 KB

overview.md

File metadata and controls

200 lines (192 loc) 路 7.52 KB

Datasets

Note: The datasets documented here are from HEAD and so not all are available in the current tensorflow-datasets package. They are all accessible in our nightly package tfds-nightly.


Usage

# Build the `tf.data.Dataset` pipeline.
ds, info = tfds.load('cifar10', split='train', shuffle_files=True, with_info=True)
ds = ds.shuffle(info.splits['train'].num_examples)
ds = ds.batch(32)

# `tfds.as_numpy` converts `tf.Tensor` -> `np.array`
for ex in tfds.as_numpy(ds):
  # `int2str` returns the human readable label ('dog', 'car',...)
  print(info.features['label'].int2str(ex['label']))

All Datasets