Do you have separate datasets for train and test? Or are you splitting one dataset into training and testing sets? If you are splitting one dataset into two you have to use the RandomSubSampler as the sampler argument of torch.utils.data.DataLoader.
Before that you would want to get a train loader. For that you use dataloader to get an iterator over the dataset. The dataloader class takes in a dataset object along with other parameters to return an iterator.
So your steps would be

create a custom dataset implementation
load that dataset using dataloader


Details about the dataset class in the tutorial are here 8.
Details about how you iterate through the data using a dataloader are here 4.
I do not know how your data is structured or about the COIL-20 dataset. Without that I can’t provide you specific help on how to do it. You should be able to follow along the tutorial to create a dataset class which can be used with torch.utils.data.DataLoader iterator.