在Debian上使用PyTorch需注意以下事项:
sudo apt install python3 python3-pip
。PATH
和LD_LIBRARY_PATH
)。pip install torch torchvision torchaudio
。pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117
。conda install pytorch torchvision torchaudio cudatoolkit=<版本> -c pytorch -c nvidia
。python3 -c "import torch; print(torch.__version__, torch.cuda.is_available())"
,确认版本及CUDA可用性。venv
或conda)隔离项目依赖。参考来源: