Order messed up with GrandParentSplitter


I was going through Walk with fastai lecture number 2, which is Image Classification from Scratch.

During the lecture, @muellerzr said that the GrandParentSplitter returns two indexes 0 and 1, where 0 and 1 imply train and validation set respectively.

But when I ran the below code the order is messed up, not sure why this happens.

# What's inside? (training and validation set [0 ,1] indexes)
sample_train = splits[0][:5]

sample_val= splits[1][:5]

sample_train, sample_val

Screenshot 2021-07-12 at 4.48.47 PM

You can clearly see that the outputs arent in the right format. I am not sure what I am doing wrong here, or is there any update made to the function GrandParentSplitter lately?

Thank you!

They are though. Index 0 was the training and index 1 was the validation. And then from there it’s a list of further indices that specify what’s in train and valid