google-cloud-platform - 没有名为 torch.distributed 的模块
问题描述
ImportError:没有名为 torch.distributed 的模块
File "train.py", line 4, in <module>
import torch.distributed as dist
ImportError: No module named torch.distributed
我安装了 CUDA 和 cuDNN 然后创建了 env 并安装了 pip3 install torch torchvision 但出现错误。
解决方案
这对我有用:
创建 conda 虚拟环境:
conda create -n env_pytorch python=3.6
在上面创建这个环境:
source activate env_pytorch
使用 pip 或 pip3 安装 PyTorch:
pip install torchvision --user
推荐阅读
- python - 给定参数时没有参数错误
- javascript - 如何处理未触发“点击”事件的按钮按下?
- javascript - 使用点击事件进行模拟 - 在 IE 11 中不起作用
- javascript - axios POST请求,body数据具体传不被识别
- matlab - R2020b:App Designer 说如果条件无法打开文件 MATLAB 失败
- c# - 如何配置一对多引用相同的主体?
- android - 缺少 Google Play 结算库
- dns - 在 Windows 10 中处于 nslookup 模式时有关命令“root”的 Nslookup 问题
- amazon-web-services - 将 CloudFormation 上的 CSV 输入到数组中
- html - 根据 div 中的可用空间自动放置图像