[Solved] Failed to get convolution algorithm. This is probably because cuDNN failed to initialize

Problem description

Failed to get convolution algorithm. This is probably because cuDNN failed to initialize


Cause analysis:

Insufficient GPU memory

Solution:

1.kill -9 PID_*
2. Dynamically allocate GPU memory:

from tensorflow.compat.v1 import ConfigProto
from tensorflow.compat.v1 import InteractiveSession

config = ConfigProto()
config.gpu_options.allow_growth = True
session = InteractiveSession(config=config)

Read More: