【Torch安装cuda版本】

经过无数次试错+尝试终于找到了最方便的安装cuda版本的Torch办法,首先可以参考这个文章检查前置条件
(主要是①检查自己的GPU版本②检查cuda驱动是否成功安装)

分别是两个命令

nivida-smi 

nvcc --version

都没有问题之后安装清华源的cuda版本的torch

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124

验证:

python -c "import torch; print(torch.__version__, torch.version.cuda, torch.cuda.is_available())"

image

 

posted @ 2026-03-07 19:55  丢丢八八  阅读(60)  评论(0)    收藏  举报