Last active
March 21, 2019 22:12
-
-
Save himanshurawlani/7753c52c80a8d637882503e9646a2b81 to your computer and use it in GitHub Desktop.
This gist shows how to use tfds.load() from TensorFlow Datasets
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 | |
SPLIT_WEIGHTS = (8, 1, 1) | |
splits = tfds.Split.TRAIN.subsplit(weighted=SPLIT_WEIGHTS) | |
(raw_train, raw_validation, raw_test), metadata = tfds.load(name="tf_flowers", | |
with_info=True, | |
split=list(splits), | |
# specifying batch_size=-1 will load full dataset in the memory | |
# batch_size=-1, | |
# as_supervised: `bool`, if `True`, the returned `tf.data.Dataset` | |
# will have a 2-tuple structure `(input, label)` | |
as_supervised=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment