欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

ImportError: Could not find ‘cudart64_100.dll‘

程序员文章站 2022-07-04 20:04:42
...

tensorflow+cuda+cudnn测试tensorflow是否安装成功时报错

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.1.105
  • cudnn 10.1
  • tensorflow 2.0.0
    根据报错信息来看是缺少cudart64_100.dll,然后让我们降级回10.0
    在之前我的环境变量都是完整配置过的,那么首先查看cuda的路径下是否存在该文件:
    通过C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA(你的cuda安装路径)路径访问cuda,在其bin目录下查找是否有cudart64_100.dll模块
    如果有,则查看环境变量是否添加;我的是没有这个文件,参照官网配置TensorFlow GPU支持看到
    ImportError: Could not find ‘cudart64_100.dll‘
    我的cuda和cudnn版本都是没有问题的,所以重新安装了tensorflow
pip install tensorflow  # 稳定版

此时tensorflow版本变为2.3.0

测试

打开cmd 输入python进入python环境

import tensorflow as tf
tf.test.is_gpu_available()

ImportError: Could not find ‘cudart64_100.dll‘
希望大家运行结果都是true

我的最终配置

  • cuda:10.1.105
  • cudnn 10.1
  • tensorflow 2.3.0

参考文献:
CUDA、CUDNN在windows下的安装及配置
GPU 支持
问题解决之“nvcc”不是内部或外部命令
tensorflow遇到ImportError: Could not find 'cudart64_100.dll’错误解决

相关标签: tensorflow cuda