pytorch-gpu安装
nvcc -V
查看cuda版本
CUDA 11.2
1 | conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.2 -c pytorch -c conda-forge |
CUDA 11.6
1 | pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116 |
测试:
1 | import torch |