How to load images dataset

I have the image dataset include :

from sklearn.model_selection import train_test_split

train_set_x,test_set_x,train_set_y,test_set_y=train_test_split(n_train_samples,n_train_labels,test_size=0.2,random_state=0)

train_set_x shape: (12000, 128, 128, 3)
train_set_y shape: (1, 12000)
test_set_x shape: (3000, 128, 128, 3)
test_set_y shape: (1, 3000)

How do I load the images into pytorch for training?

You can make use of Dataset module and further DataLoader module provided by Pytorch for feeding images to your designed network.

1 Like

I found downloaded imagenet and found it painful to figure out to train a model using it…
It would be VERY useful if pytorch people provide an example (or tutorial) just to let us know how should we use imagenet and load the data