In previous Tensorflow version it was possible to use tfds.Split
API which is now deprecated:
(training_set, validation_set), dataset_info = tfds.load('tf_flowers',split=[tfds.Split.TRAIN.subsplit(tfds.percent[:70]),tfds.Split.TRAIN.subsplit(tfds.percent[70:])],with_info=True,as_supervised=True,)
If you need to allocate training
, validation
, and test
subsets (70%, 15%, 15%), this is the code (got it from here)
(training_set, validation_set, test_set), dataset_info = tfds.load('tf_flowers',split=['train[:70%]', 'train[70%:85%]', 'train[85%:]',with_info=True,as_supervised=True,)