python 报错:AttributeError: module ‘torch.utils.data.dataset‘ has no attribute ‘MNIST‘

或者报错AttributeError: module 'torch.utils.data' has no attribute 'datasets'

原因:导包错误

解决:

import torchvision.datasets as datasets # pytorch中的数据集包

你可能感兴趣的:(pytorch,python,pytorch)