安裝報錯
按PyTorch官網給出的命令
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
報錯
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch
原因:當前python版本過低(我是3.6)
解決方法:用Anaconda重新建一個Python高版本環境(比如3.10)
RuntimeError: Distributed package doesn‘t have NCCL built in
我的是Windows系統,不支持nccl
在運行的py文件最開始加代碼
import os
os.environ["PL_TORCH_DISTRIBUTED_BACKEND"] = "gloo"
修改類似地方,把nccl改成gloo
torch.distributed.init_process_group("nccl")