Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tensorflow issue google colab ; tensorflow._api.v1.compat.v2' has no attribute '__internal__

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

like image 594
nada belhadjslimen Avatar asked Oct 23 '25 05:10

nada belhadjslimen


1 Answers

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)

like image 138
2 revsTFer2 Avatar answered Oct 25 '25 19:10

2 revsTFer2



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!