tensorflow2.x 运行出现 tensorflow.python.framework.errors_impl.UnknownError: Failed to get convolution algorithm.

  1. 检查CUDA 和 cudnn版本是否正确且匹配

  2. 尝试在代码前增加以下代码可以解决(本人机器解决)
    ref: https://blog.csdn.net/qq_35407318/article/details/107822918

    physical_devices = tf.config.experimental.list_physical_devices('GPU')
    assert len(physical_devices) > 0, "Not enough GPU hardware devices available"
    tf.config.experimental.set_memory_growth(physical_devices[0], True)
原文地址:https://www.cnblogs.com/wioponsen/p/15216272.html