如题,在写深度学习的时候,写到
# 读取torchvision中预存的数据集
transform = transforms.Compose([transforms.ToTensor(),
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])
train_set = torchvision.datasets.CIFAR10(root='./data',
train=True,
download=True,
transform=transform)
train_loader = torch.utils.data.DataLoader(dataset=train_set,
shuffle=True,
batch_size=4,
num_workers=0)
for index,i in enumerate(train_loader):
如果用python3.8,for循环的地方就会出错,提示我:
TypeError: array() takes 1 positional argument but 2 were given
但是我切换python3.6就没事了,请问,这两个版本对于循环有什么要求么,python3.8是有什么额外的规定么