在Ubuntu上获取PyTorch资源,可参考以下方法:
conda create -n pytorch_env python3.9
,激活后conda install pytorch torchvision torchaudio pytorch-cuda11.8 -c pytorch -c nvidia
(将11.8
替换为所需CUDA版本)。pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
,指定版本安装则修改对应版本号。nvidia - smi
查看显卡及CUDA版本,再从NVIDIA官网下载对应版本的安装包进行安装。