How to use MNIST images in testing folder as validation set

When you download the MNIST file with untar_data, you get training folder and testing folder.


I want to use images in testing folder as the validation set but all I know is how to create a separate validation set with DataBlock’s RandomSplitter method from the training set.
Can anyone help?

Hi Jessica,

When you create DataBlocks there are different helper functions for processing basic data and transformations. To split the data into training and validation sets, you can use the GrandparentSplitter method instead of RandomSplitter:

GrandparentSplitter(train_name='training', valid_name='testing')

I hope you find it useful! :slight_smile:

2 Likes

Thank you!