Last active
October 31, 2019 22:45
-
-
Save MikeOfZen/1c1ce51d87ba40c71ff73bdf498fafe6 to your computer and use it in GitHub Desktop.
[tfds get dataset] get dataset and do split 3 way #tf #python #split #dataset #tfds
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
DATA_DIR="/tmp" | |
test_split, valid_split, train_split = tfds.Split.TRAIN.subsplit([10, 10, 80]) | |
test_set = tfds.load("cats_vs_dogs:4.*.*",data_dir=DATA_DIR, split="train[:10%]", as_supervised=True) | |
valid_set = tfds.load("cats_vs_dogs:4.*.*",data_dir=DATA_DIR, split="train[10%:20%]", as_supervised=True) | |
train_set = tfds.load("cats_vs_dogs:4.*.*",data_dir=DATA_DIR, split="train[20%:]", as_supervised=True) | |
#tfds.load is called multiple times for each slice, the 'train' split name is taken from the dataset documentation |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment