python - TensorFlow 问题 google colab ; tensorflow._api.v1.compat.v 2' has no attribute ' __internal__

标签 python tensorflow keras google-colaboratory

Tensorflow 问题 google colab:模块 'tensorflow._api.v1.compat.v2' 没有属性 '内部 '
我在谷歌 colab 上运行一个 MASK RCNN 模型,使用 tensorflow 1.15 和 keras 2.1.6 一切正常,但今天,我收到了这个错误:
enter image description here

最佳答案

为了社区提供解决方案的利益,尽管它在 Github 中提供.
最近colab已升级为 TF 2.5.0 , 强制升级到 keras-nightly 2.5.0.dev2021032900 .
最近影响您的更改是安装 keras-nightly ,与 !pip install 不兼容非夜间 keras .添加 !pip uninstall keras-nightly之前 import keras使错误消失。
来自评论

 !pip uninstall keras-nightly

 !pip uninstall -y tensorflow

 !pip install h5py==2.10.0  

Followed by fresh installation of tensorflow and keras as per requirement has solved the problem (paraphrased from nada belhadjslimen)

关于python - TensorFlow 问题 google colab ; tensorflow._api.v1.compat.v 2' has no attribute ' __internal__,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67703514/

相关文章:

python - 连接时间序列神经网络和前馈神经网络

python - os.path.exists 不适用于特定目录

python - 防止 symfit 模型共享参数对象

python - 如何将 NumPy 数组图像转换为 TensorFlow 图像?

tensorflow - tf.data OutOfRangeError(回溯见上文): End of sequence

python - 检查值是否高于阈值,如果是,则替换为

Python 在对相同对象执行相同操作两次时给出了两个不同的结果

python - 使用生成器 ( python ) 解析 fasta 文件

python - tf.space_to_depth 有什么用?

python - 在 Tensorflow-lite 中输入具有动态尺寸的图像