【问题标题】:windows - tensorflow - Fail to find the dnn implementation and GPU not detected on older tensorflow versionwindows - tensorflow - 无法找到 dnn 实现并且在较旧的 tensorflow 版本上未检测到 GPU
【发布时间】:2022-12-26 01:32:02
【问题描述】:

我正在运行以下版本:

windows 10
cuda 11.6
cudnn 8.4
python 3.8.10

这些版本在我运行 torch 模型时有效(我可以在 GPU 上运行 torch 模型!)。

我正在尝试安装和运行tensorflow 模型。

当我安装 tensorflow 2.4.02.4.1 时,未通过以下方式检测到 GPU:

import tensorflow
physical_devices = tensorflow.config.list_physical_devices('GPU')

未检测到 GPU(physical_devices 为空)

当我升级tensorflow版本到2.8时,检测到GPU(physical_devices不为空)

在构建和拟合我的 tensorflow (tensorflow.keras) 模型之前,我运行了以下命令:

import tensorflow
physical_devices = tensorflow.config.list_physical_devices('GPU')
tensorflow.config.experimental.set_memoty_growth(physical-devices[0], enable=True)

但我收到错误:

Failed to find the dnn implementation
  • 我无法更改CUDA & CUDNN 版本,因为它们适用于我的torch 模型(使用 GPU 并且在那里工作正常)。

我需要做什么才能在我的机器上使用带有 GPU 的tensorflow

【问题讨论】:

    标签: tensorflow keras tf.keras


    【解决方案1】:

    配置设置与系统中安装的 Tensorflow versioncuDNN 8.4CUDA 11.6 不匹配。这就是上述错误的原因。

    根据此 tested build configuration,您需要安装 cuDNN 8.1CUDA 11.2 才能在系统中支持 GPU 的情况下运行 TensorFlow 2.8。因此,请通过安装链接中提到的确切配置设置重试。

    【讨论】:

      猜你喜欢
      • 2019-10-13
      • 2017-09-15
      • 2018-05-31
      • 2020-12-10
      • 2020-01-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-26
      相关资源
      最近更新 更多