Google cloud platform 没有名为torch.distributed的模块

Google cloud platform 没有名为torch.distributed的模块,google-cloud-platform,pytorch,Google Cloud Platform,Pytorch,ImportError:没有名为torch.distributed的模块 File "train.py", line 4, in <module> import torch.distributed as dist ImportError: No module named torch.distributed 文件“train.py”,第4行,在 导入火炬。作为dist分发 ImportError:没有名为torch.distributed的模块 我安装了CUDA和cuDNN

ImportError:没有名为torch.distributed的模块

File "train.py", line 4, in <module>
    import torch.distributed as dist
ImportError: No module named torch.distributed
文件“train.py”,第4行,在
导入火炬。作为dist分发
ImportError:没有名为torch.distributed的模块
我安装了CUDA和cuDNN,然后创建了env并安装了pip3安装torch torchvision,但出现了错误。

这对我很有用:

  • 创建conda虚拟环境:

    conda create -n env_pytorch python=3.6
    
  • 活动此环境可在上面创建:

    source activate env_pytorch
    
  • 使用pip或pip3安装PyTorch:

    pip install torchvision --user
    
  • 这对我很有用:

  • 创建conda虚拟环境:

    conda create -n env_pytorch python=3.6
    
  • 活动此环境可在上面创建:

    source activate env_pytorch
    
  • 使用pip或pip3安装PyTorch:

    pip install torchvision --user
    

  • 您是否记得激活您的虚拟环境?是的,我激活了虚拟环境您记得激活您的虚拟环境吗?是的,我激活了虚拟环境