torch.cuda.is

torch.cuda.is,第1张

原因

pytorch版本与cuda版本不匹配,我想强调的是必须完全匹配上,比如你的cuda是9.0,则pytroch cuda版本也要9.0,不能9.1,9.2!

*** 作步骤

1.查看cuda版本,cmd中输入

nvcc -V

2.网站*https://pytorch.org/get-started/previous-versions/*中查找该cuda版本对应的pytorch版本

3.输入相应命令进行安装
(1)新建环境

conda create -n pytorch_gpu-cude9.0 python=3.7

(2)进入环境

activate pytorch_gpu-cude9.0

(3) 粘贴对应Pytorch版本

conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=9.0 -c pytorch

(4)安装成功后测试

更换cuda版本

安装了多个cuda,想要换版本参考如下方法:
https://blog.csdn.net/Timeloser_tong/article/details/123293000?spm=1001.2014.3001.5506

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/904570.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-15
下一篇2022-05-15

发表评论

登录后才能评论

评论列表(0条)

    保存