我创建了一个 v.environment
,其中有 Python 版本 3.6.5,并安装了 tensorflow-gpu
。
TensorFlow的版本是1.4.0,Keras的版本是2.6.0。
当我在脚本 import keras
上写入时,出现以下错误:
ImportError: cannot import name 'tf2'
你有什么想法吗?
最佳答案
来自评论
Here the problem caused by the
TF
is too old, and thekeras
is too new. Your choice is to downgradekeras
to2.2.1
, or use newer version oftf
(paraphrased by Vinson Ciawandy & homomathematicus)
关于python - 无法导入名称 'tf2',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69132718/