I current ran into a problem that when using the cifar-10 dataset, I need to separate the label from the image itself, and convert them into two contiguous arrays.
For the inputs this array contains all the test images, flattened.
For the labels this array contains all the labels (non-one-hot) in order.
When using theano, each image has x,y two parameters to represent image and label.

image.png900×293 16.7 KB


image.png886×250 13.2 KB

However, it seems that Pytorch has its own way to read the cifar-10 images and I don’t know how to save the images and labels separately.
Looking forward to your suggestions.