python - 模块 'keras.api._v2.keras.experimental' 没有属性 'PeepholeLSTMCell'

标签 python tensorflow google-colaboratory tensorflow-federated

我尝试在 google colab 中安装 tensorflow_federated。我用过

pip install --quiet tensorflow-federated-nightly
import tensorflow-federated as tff

它奏效了。但是现在当我尝试导入它时出现此错误:

AttributeError: module 'keras.api._v2.keras.experimental' has no attribute 'PeepholeLSTMCell'

我不知道为什么会出现这个错误,因为我之前没有任何问题。

我还使用了以下代码来安装 tensorflow-federated:

pip install --upgrade tensorflow-federated-nightly 

但我得到了同样的错误。

我该如何解决?

我的版本是:

tensorflow 2.8.0, keras 2.8.0tensorflow-federated-nightly 0.19.0.dev20220218

最佳答案

要将 TensorFlow Federated 与 TensorFlow 2.8.0 一起使用,请尝试新发布的 TFF 0.20.0 版本 pypi , github .

tensorflow-federated-nightly 包依赖于夜间版本的 TensorFlow (tf-nightly), Keras (keras-nightly)等等。

关于python - 模块 'keras.api._v2.keras.experimental' 没有属性 'PeepholeLSTMCell',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71251685/

相关文章:

python - matplotlib - 如何绘制随机定向的矩形(或任何形状)?

python - 重新实现QWebView复制链接

python - SublimeREPL 到 python

python - Keras 的 fit_generator 额外训练值

python - Google 的 TensorFlow 中的 Theano Dimshuffle 等效?

python - 错误:tensorflow:Couldn't understand architecture name '.50_%image_size%'

Python:分离模块中的异常工作错误

list - 如何更新tensorflow中优化器需要更新的变量列表?

powershell - 如何在 Windows 10 上使用 Powershell 将 Google Colab 与本地 TensorFlow Jupyter 服务器结合使用?

tensorflow - Google colab pro GPU 运行速度极慢