该模型不适合 GPU 的 Tensorflow 和 Keras 错误



我安装了cuda 11.0和cudnn 8.0与tensorflow-gpu 2.4.0。当我拟合模型时,我得到这个错误。

UnknownError:  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.
[[node sequential/conv2d/Relu (defined at <ipython-input-23-397fbbe99754>:1) ]] [Op:__inference_train_function_1671]
Function call stack:
train_function

我试图安装keras-gpu,但所有环境和tensorflow都不起作用。

import tensorflow as tf
gpu = tf.config.experimental.list_physical_devices('GPU')
print("Num GPUs Available: ", len(gpu))
tf.config.experimental.set_memory_growth(gpu[0], True)

解决错误。

最新更新