cuDNN初始化失败
W tensorflow/core/common_runtime/base_collective_executor.cc:217] BaseCollectiveExecutor::StartAbort Unknown:
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 conv2d_1/convolution}}]]
中文翻译过来就是:
错误:无法获取卷积算法。这可能是因为cuDNN初始化失败,所以请尝试查看上面是否打印了警告日志消息。
问题原因:
在使用conda安装TF的时候,conda会把所有的依赖项都安装好,甚至CUDA和cuDNN,但是cuDNN的版本对TF来说是很低的,所以会带来兼容性的问题。
解决方案
import tensorflow as tf
gpus= tf.config.experimental.list_physical_devices('GPU')
tf.config.experimental.set_memory_growth(gpus[0], True)