问题描述

Windows环境下tensorflow的报错信息为:

Could not load library cudnn_cnn_infer64_8.dll. Error code 126
Please make sure cudnn_cnn_infer64_8.dll is in your library path!

我的cuda版本为11.5,cudnn版本是与之对应的11.5。

解决方法

我重装了cuda 11.5与对应的cudnn,反复确认二者版本一致,但不能解决问题。
查找cuda路径,cudnn_cnn_infer64_8.dll文件是存在的,但tensorflow无法导入。
该文件负责CNN底层运算,因此该问题不解决,模型无法运行。
有两种解决方式:

  • 在保持cuda版本为11.5的情况下,安装cuDNN v8.2.2 (July 6th, 2021), for CUDA 11.4。原问题是由于cuDNN与cuda不匹配导致的。为什么官方的版本还是不匹配?或许这就叫bug吧!
  • 使用WinDLL(path)手工导入该文件路径,但并不推荐这一方式,因为每当需要运行CNN时都需要手动导入一遍。

需要说明的一点是,如果你的cuda版本不是11.5但依旧出现了这一问题,请检查如下两点:

  • 你的显卡是否支持当前的cuda版本
  • cuda版本是否与cudnn版本匹配
GitHub 加速计划 / te / tensorflow
33
4
下载
一个面向所有人的开源机器学习框架
最近提交(Master分支:1 个月前 )
4f64a3d5 Instead, check for this case in `ResolveUsers` and `ResolveOperand`, by querying whether the `fused_expression_root` is part of the `HloFusionAdaptor`. This prevents us from stepping into nested fusions. PiperOrigin-RevId: 724311958 3 个月前
aa7e952e Fix a bug in handling negative strides, and add a test case that exposes it. We can have negative strides that are not just -1, e.g. with a combining reshape. PiperOrigin-RevId: 724293790 3 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐