Failed to get convolution algorithm. This is probably because cuDNN failed to initialize,
I had this error and I fixed it by uninstalling all CUDA and cuDNN versions from my system. Then I installed CUDA Toolkit 9.0 (without any patches) and cuDNN v7.4.1 for CUDA 9.0.
UnknownError: Failed to get convolution algorithm
Below code solved the issue :
import tensorflow as tf
gpus = tf.config.experimental.list_physical_devices('GPU')
if gpus:
try:
for gpu in gpus:
tf.config.experimental.set_memory_growth(gpu, True)
except RuntimeError as e:
print(e)
Related Topics
How to Round the Minute of a Datetime Object
Python Requests - How to Use System Ca-Certificates (Debian/Ubuntu)
How to Force Python to Be 32-Bit on Snow Leopard and Other 32-Bit/64-Bit Questions
How to Format Date String via Multiple Formats in Python
Time Complexity of String Slice
Pandas: Multiple Columns into One Column
Is There a Generator Version of 'String.Split()' in Python
Generate All Permutations of a List Without Adjacent Equal Elements
Running Interactive Commands in Paramiko
Cannot Pass an Argument to Python with "#!/Usr/Bin/Env Python"
How to Run Python Script Without Typing 'Python ...'
Time Complexity of Python Set Operations
How to Use Selenium with Python
Use Python's String.Replace VS Re.Sub
Super() Raises "Typeerror: Must Be Type, Not Classobj" for New-Style Class