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


    tensorflow 在 gpu 上训练时报如下错误

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

    解决办法

    加上如下代码

    import os
    import tensorflow as tf
    from tensorflow import ConfigProto
    from tensorflow import InteractiveSession
    
    # 注意如果还报错,加在代码开头试试
    os.environ['CUDA_VISIBLE_DEVICES'] = '0'
    # os.environ['CUDA_VISIBLE_DEVICES'] = '/gpu:0'
    config = ConfigProto()
    config.gpu_options.allow_growth = True
    session = InteractiveSession(config=config)
    # session = tf.Session(config=config)

    这是 GPU 显存不够了,上面代码意思是对 GPU 进行按需分配

    参考资料:

    https://blog.csdn.net/tsyccnh/article/details/102938368

    https://www.cnblogs.com/xiaxuexiaoab/p/12388388.html

    https://www.jianshu.com/p/e13aa15f35da  tensorflow2.0卷积报错:Failed to get convolution algorithm. This is probably because cuDNN failed to i...

  • 相关阅读:
    斐波那契数列的递归和非递归实现
    二叉树遍历
    基础总结
    内部类
    I/O dempo
    读取文件注意事项
    eclipse 主题设置
    String 常用函数
    多态的理解
    ffmpeg处理RTMP流媒体的命令大全
  • 原文地址:https://www.cnblogs.com/yanshw/p/15497590.html
Copyright © 2020-2023  润新知