Tensorflow 问题 google colab ;tensorflow._api.v1.compat.v2' 没有属性 '__internal__ [英] Tensorflow issue google colab ; tensorflow._api.v1.compat.v2' has no attribute '__internal__

查看:40
本文介绍了Tensorflow 问题 google colab ;tensorflow._api.v1.compat.v2' 没有属性 '__internal__的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Tensorflow 问题 google colab:模块 'tensorflow._api.v1.compat.v2' 没有属性 'internal'我在 google colab 上运行 MASK RCNN 模型使用 tensorflow 1.15 和 keras 2.1.6 一切正常,但今天,我收到了这个错误:在此处输入图片描述

解决方案

为了社区在此处提供解决方案的利益,尽管它在 Github.

最近colab 升级到TF 2.5.0,强制升级到keras-nightly 2.5.0.dev2021032900.

最近影响您的更改是 keras-nightly 的安装,它与非夜间 keras!pip install 不兼容.在 import keras 之前添加 !pip uninstall keras-nightly 会使错误消失.

来自评论

<块引用>

 !pip 卸载 keras-nightly!pip 卸载 -y tensorflow!pip install h5py==2.10.0

然后根据要求全新安装 tensorflow 和 keras已经解决了这个问题(转述自 nada belhadjslimen)

Tensorflow issue google colab : module 'tensorflow._api.v1.compat.v2' has no attribute 'internal' I am running a MASK RCNN model on google colab With tensorflow 1.15 and keras 2.1.6 every thing work correctly but Today, I got this error: enter image description here

解决方案

For the benefit of community providing solution here though it is presented in Github.

Recently colab was upgraded to TF 2.5.0, forcing an upgrade to keras-nightly 2.5.0.dev2021032900.

The recent change affecting you is the install of keras-nightly, which is incompatible with !pip install of non-nightly keras. Adding !pip uninstall keras-nightly before import keras makes the error go away.

From comments

 !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)

这篇关于Tensorflow 问题 google colab ;tensorflow._api.v1.compat.v2' 没有属性 '__internal__的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆