Created
February 22, 2019 22:53
-
-
Save rsepassi/cc5d074dcac1dbb560ba2540cccd633c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow_datasets as tfds | |
# Download the dataset and create a tf.data.Dataset | |
ds, info = tfds.load("mnist", split="train", with_info=True) | |
# Access relevant metadata with DatasetInfo | |
print(info.splits["train"].num_examples) | |
print(info.features["label"].num_classes) | |
# Build your input pipeline | |
ds = ds.batch(128).repeat(10) | |
# And get NumPy arrays if you'd like | |
for ex in tfds.as_numpy(ds): | |
np_image, np_label = ex["image"], ex["label"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment