ModuleNotFoundError:使用 from tensorflow.contrib.seq2seq import Helper 时没有名为“tensorflow.contrib”的模块

宽动态

标题可能与其他帖子相似,但我在这里问的是具体的,尚未有人回答。所以我需要你的帮助

ModuleNotFoundError: No module named 'tensorflow.contrib尝试时出现以下错误

from tensorflow.contrib.seq2seq import Helper

我已经安装了 tensorflow-addons。from tensorflow_addons.seq2seq import Helper也不工作

我需要从 seq2seq 导入 Helper

我应该怎么办?

我的 tensorflow 版本是 2.2.0

我的 tensorflow-addons 版本是 0.11.2

迪特·梅斯

tf.contrib 在 tensorflow 2.x 中不存在,它只是部分地移动到这里提到的 tensorflow 插件:https : //github.com/tensorflow/tensorflow/issues/31350#issuecomment-566151053

您是否尝试过安装 tensorflow 1.15 并重新运行代码?

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章