Python 没有名为';torch.utils.data.distributed';

Python 没有名为';torch.utils.data.distributed';,python,anaconda,pytorch,Python,Anaconda,Pytorch,我已经在windows 10上安装了anaconda和pytorch,安装时没有错误 但我不知道为什么我没有pytorch中的模块或包。 你经历过同样的问题吗 这是我正在测试的程序:因为您没有提供任何其他信息,所以您可以尝试以下几种方法: 1) 首先确保您已经安装了torchvision 2) 然后尝试以下导入: # this import is necessary import torch.utils.data 谢谢。但是我已经安装了torchvision。这是我的导入:导入torch导入t

我已经在windows 10上安装了anaconda和pytorch,安装时没有错误

但我不知道为什么我没有pytorch中的模块或包。 你经历过同样的问题吗


这是我正在测试的程序:

因为您没有提供任何其他信息,所以您可以尝试以下几种方法:

1) 首先确保您已经安装了
torchvision

2) 然后尝试以下导入:

# this import is necessary
import torch.utils.data

谢谢。但是我已经安装了torchvision。这是我的导入:导入torch导入torch.nn as nn导入torch.nn.parallel导入torch.backends.cudnn as cudnn导入torch.distributed as dist导入torch.optim导入torch.utils.data导入torch.data.distributed导入torchvision.transforms as transforms导入torchvision.DataSet as数据集将torchvision.models作为模型导入