Tensorflow - Splitting Record Files Into Train & Validation Sets
Python
Takes the list of Tensorflow records stored in the data\tfrecords folder, and splits them into training and validation filenames with 30% being used for validation.
1| import tensorflow as tf 2| from sklearn.model_selection import train_test_split 3| 4| TRAINING_FILENAMES, VALIDATION_FILENAMES = train_test_split( 5| tf.io.gfile.glob(r'data\tfrecords\ld_train*.tfrec'), 6| test_size=0.3, random_state=101 7| )
131
118
115
108