win10下安装tensorflo-gpu+cuda+cudnn,超简单

tensorflow-gpu、cuda、cudnn之间是有版本关系的,在不知道对应关系的情况下如何安装

第一步,安装python。

这里推荐使用anaconda安装,用过的人都说好。

第二步,pip install tensorflow

第三步,pip install tensorflow-gpu

这里要先安装tensorflow-gpu是因为,tensorflow-gpu、cuda、cudnn之间有版本关联。所以我们先安装tensorflow-gpu,然后运行tensorflow-gpu测试程序,必定会报错。按照“遇到问题解决问题”的思路,我们就可以根据错误提示安装对应的cuda版本!

比如:ImportError: Could not find 'cudart64_100.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Download and install CUDA 10.0 from this URL: https://developer.nvidia.com/cuda-90-download-archive

看到没有,报错信息里明确的提示了,安装CUDA 10.0,它给的链接是9.0版本的,不要下载!

安装完了之后重启电脑,继续运行测试程序,会继续报错:ImportError: Could not find 'cudnn64_7.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Note that installing cuDNN is a separate step from installing CUDA, and this DLL is often found in a different directory from the CUDA DLLs. You may install the necessary DLL by downloading cuDNN 7 from this URL: https://developer.nvidia.com/cudnn

根据报错提示安装cudnn7版本64位,根据给出的链接,注册之后就可以下载了

把下载下来的压缩文件解压,并复制到cuda的安装目录下,cuda的默认安装目录为:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0

至此安装完成,然后再次运行测试程序。OK

测试代码参考https://blog.youkuaiyun.com/william_hehe/article/details/79615894

 

 

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值