win10使用gpu运行keras遇到的问题

相关:之前写过使用tensorflow-gpu遇到的问题 https://blog.csdn.net/ZhangDanzhu/article/details/83902821
现在换了电脑,同时又接触了keras,遇到一些问题,记录一下


1 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版本并安装,我的默认安装于C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0
安装完后相应地配置好环境变量:在系统环境变量path中增加CUDA的bin目录
在这里插入图片描述
同时检查一下是否有以下两个环境变量
在这里插入图片描述
可以通过在cmd中输入 nvcc -V来检查是否安装配置成功。
在这里插入图片描述

2 cuDNN安装

安装完CUDA后,换了个报错
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
解决办法
去提示的网站上下载对应版本的cuDNN,然后解压,将bin中的cudnn64_7.dll复制到原来CUDA路径中bin目录下。(别的好像不需要,看情况可以一起复制到相对应的路径下)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值