In the below code , I see that we are loading the data into the variable “trainloader” and iterating through the same. In the below example, the code assumes that there are two columns of data , images & labels respectively. How do I check the shape and column headers in the data “trainloader” . Any help is much appreciated.
Download and load the training data
trainset = datasets.MNIST('~/.pytorch/MNIST_data/', download=True, train=True, transform=transform) trainloader = torch.utils.data.DataLoader(trainset, batch_size=64, shuffle=True)
dataiter = iter(trainloader) images, labels = dataiter.next() print(type(images)) print(images.shape) print(labels.shape)