当我要使用mnist数据集时,我的代码有问题 它给了我这个错误:
Traceback (most recent call last):
File "C:\Users\Ati\Desktop\GD\GD.py", line 306, in <module>
update_interval=update_interval, max_prob=max_prob, plot=plot, train=train, gpu=gpu)
File "C:\Users\Ati\Desktop\GD\GD.py", line 105, in main
images, labels = dataiter.next()
ValueError: too many values to unpack (expected 2)
我认为问题与代码的这一部分有关:
transform = transforms.Compose([transforms.ToTensor(),
transforms.Normalize((0.5,), (0.5,)),
])
dataset = MNIST(root='root', download=True , transform=transform)
trainloader = torch.utils.data.DataLoader(dataset, batch_size=1, shuffle=True)
dataiter = iter(trainloader)
images, labels = dataiter.next()
images, labels = images.view(-1, 784) / 255, labels)
有人可以帮我一个忙吗