Error in using Tensorflow-GPU:
Error
Could not create cudnn handle: CUDNN_STATUS_NOT_INITIALIZED
***Error: Failed to get convolution algorithm. This is probably because cuDNN Failed to initialize, so try looking to see if a warning log message was printed above.
The error mainly points to cudnn, but the CUDA version and cudnn version are in line with the current tensorflow requirements (meaning there is no need to change the CUDA version and cudnn version)
, so it can only be caused by GPU use problem (meaning it is not the fault caused by the program needs to call GPU for many times)
The solution: **
Set GPU on-demand allocation mode
Tensorflow – GPU 2.3.1(be aware of the version of TensorFlow)****
config= tf.compat.v1.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.7 #0.7parameter, meaning the percentage allocated to gpu-memory.
sess=tf.compat.v1.Session(config=config)
Older version of TensorFlow-GPU
`config= tf.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.7 #0.7parameter, meaning the percentage allocated to gpu-memory.
sess=tf.Session(config=config)`
* Set GPU to apply video memory dynamically
Tensorflow – GPU 2.3.1(be aware of the version of TensorFlow)****
config = tf.compat.v1.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.compat.v1.Session(config=config)
Older version of TensorFlow-GPU
`config = tf.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.Session(config=config)
Please insert the above code into the front of any part of the program to solve the problem
Read More:
- Tensorflow Error: Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
- Tensorflow Run Error or the interface is stuck or report error: Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
- [Solved] Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
- [Solved] RuntimeError: cuDNN error: CUDNN_STATUS_INTERNAL_ERROR
- CUDA error: CUBLAS_STATUS_NOT_INITIALIZED when calling `cublasCreate(handle)`
- [Solved] Tensorflow Error: failed to create cublas handle: CUBLAS_STATUS_ALLOC_FAILED
- [Solved] TF2.4 Error: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize
- [Solved] Failed to get convolution algorithm. This is probably because cuDNN failed to initialize
- RuntimeError: CUDNN_STATUS_EXECUTION_FAILED [How to Solve]
- [Solved] Could not load library cudnn_cnn_infer64_8.dll. Error code 126
- Tensorflow GPU error (4 Type Error and their Solutions)
- Failed to get convolution algorithm. This is probably because cuDNN failed to initialize,
- Opencv Can not Find opencv2/gpu/gpu.hpp [How to Solve]
- [Solved] Tensorflow2.0 Error: Function call stack:distributed_function
- [Solved] Tensorflow error or keras error and tf.keras error: oom video memory is insufficient
- Tensorflow Error polling for event status: failed to query event: CUDA_ERROR_ILLEGAL_ADDRESS
- [SteamVR] Not Initialized (109) Error [How to Solve]
- [Solved] RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling `cublasCreate(handle)`
- [Solved] Tensorflow-gpu 2.0.0 Run Error: ModuleNotFoundError: No module named ‘tensorflow_core.estimator‘
- TensorFlow-gpu Error: failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected