【问题标题】:cuDNN installed but could not initializingcuDNN 已安装但无法初始化
【发布时间】:2020-06-19 03:34:08
【问题描述】:

我正在尝试在我的计算机上训练 SegNet。我有 GTX860M 显卡。 nvidia-driver-440、cuda 10.1 和 cuDNN7 已安装,但错误消息显示无法创建 cudnn 句柄。 cuDNN 对我的其他模型没有任何问题。我试图减少批量大小,但没有帮助。我该如何解决这个问题?

错误

Epoch 1/10
2020-06-18 18:59:04.172516: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7
2020-06-18 18:59:04.664514: E tensorflow/stream_executor/cuda/cuda_dnn.cc:329] Could not create cudnn handle: CUDNN_STATUS_NOT_INITIALIZED
2020-06-18 18:59:04.664608: E tensorflow/stream_executor/cuda/cuda_dnn.cc:337] Possibly insufficient driver version: 440.82.0
2020-06-18 18:59:04.666215: E tensorflow/stream_executor/cuda/cuda_dnn.cc:329] Could not create cudnn handle: CUDNN_STATUS_NOT_INITIALIZED
2020-06-18 18:59:04.666252: E tensorflow/stream_executor/cuda/cuda_dnn.cc:337] Possibly insufficient driver version: 440.82.0

nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243

cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2

#define CUDNN_MAJOR 7
#define CUDNN_MINOR 6
#define CUDNN_PATCHLEVEL 5
--
#define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL)

#include "driver_types.h"

【问题讨论】:

    标签: python tensorflow keras


    【解决方案1】:

    我解决了这个问题。是内存分配问题。

    from keras.backend.tensorflow_backend import set_session
    physical_devices = tf.config.experimental.list_physical_devices('GPU')
    assert len(physical_devices) > 0, "Not enough GPU hardware devices available"
    config = tf.config.experimental.set_memory_growth(physical_devices[0], True)
    sess = tf.Session(config=config)
    set_session(sess)
    

    https://kobkrit.com/using-allow-growth-memory-option-in-tensorflow-and-keras-dc8c8081bc96

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-02-10
      • 2015-11-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-25
      • 1970-01-01
      相关资源
      最近更新 更多