could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR

前端 未结 19 2563
故里飘歌
故里飘歌 2020-12-01 16:01

I installed tensorflow 1.0.1 GPU version on my Macbook Pro with GeForce GT 750M. Also installed CUDA 8.0.71 and cuDNN 5.1. I am running a tf code that works fine with non C

19条回答
  •  情书的邮戳
    2020-12-01 16:23

    It has to do with the memory fraction available to load GPU resources to create cudnn handle, also known as per_process_gpu_memory_fraction. Reducing this memory fraction by yourself will solve the error.

    > sess_config = tf.ConfigProto(gpu_options =
    > tf.GPUOptions(per_process_gpu_memory_fraction=0.7),
    > allow_soft_placement = True)
    > 
    > with tf.Session(config=sess_config) as sess:
    >      sess.run([whatever])
    

    Use as small fraction as could fit in your memory. (In the code, I use 0.7, you can start with 0.3 or even smaller, then increase until you get the same error, that's your limit.) Pass it to your tf.Session() or tf.train.MonitoredTrainingSession() or Supervisor's sv.managed_session() as config.

    This should allow your GPU create a cudnn handle for your TensorFlow code.

提交回复
热议问题