环境:
window 8.1 64 位 python 3.7.7 64 位 tensorflow 2.3 喀拉斯 2.4
CUDA:10.1 CuDNN:7
错误:InvalidArgumentError:断言失败:[0] [Op:Assert] 名称:EagerVariableNameReuse
。
问题:在 GPU 执行时的简单语句 model = Sequential()
中出现上述错误
但如果我在没有 GPU 的情况下运行脚本(不设置 CUDA/CuDnn 环境变量,它会按预期工作。
如此有效,我有一个 GPU,但不能与 TensorFlow(2.3) 一起使用
有人可以帮忙吗?
最佳答案
据我所知,这个问题出现在以下致命组合中。
- Windows 操作系统
- tensorflow 2.3.x
我一直在努力解决这个问题,直到最近才弄明白。
最简单的修复
最简单的解决方案是使用 TensorFlow 2.4.0rcx。它仍处于预发布阶段。但是没有给我上述问题。所以,
pip uninstall tensorflow
pip install tensorflow==2.4.0rc0
如果你想继续使用 TF 2.3.x 的解决方案
如果您真的坚持使用 TensorFlow 2.3.x,那么唯一的解决方案似乎是,
- 试用基于 Linux 的操作系统 (Ubuntu)
- 从源代码编译 TensorFlow(根据 this helpful 评论)
关于TensorFlow 2.3 GPU - InvalidArgumentError : assertion failed: [0] [Op:Assert] name: EagerVariableNameReuse,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64066041/