4

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

3
  • I am getting the same error. Anyone else facing the same problem? Any solutions? Commented May 26, 2021 at 17:51
  • I haven't found a solution yet Commented May 26, 2021 at 17:59
  • solution : !pip uninstall keras-nightly /// pip uninstall -y tensorflow //// !pip install h5py==2.10.0 Commented May 28, 2021 at 8:25

1 Answer 1

3

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)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.