有时候tf gpu版本号和cuda cudnn 不对应,有禁止调用gpu的需求:

    import os
    os.environ["CUDA_VISIBLE_DEVICES"] = "-1"   # 禁止调用gpu

备忘一下,主要参考博主:

链接

更多推荐