About dataset separating

in dataset, normally train set and test set is separated. but i use a food dataset. contains 101 folder for 101 types of food. train and test is not separated. how can i use this ? plz help.

You can use torch.utils.data.random_split() for seperating the dataset into test and train by passing the length of test and train dataset.


Google for random_split() in pytorch to know more about the function.

1 Like