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
-
I am getting the same error. Anyone else facing the same problem? Any solutions?hrishabh upadhyay– hrishabh upadhyay2021-05-26 17:51:49 +00:00Commented May 26, 2021 at 17:51
-
I haven't found a solution yetnada belhadjslimen– nada belhadjslimen2021-05-26 17:59:41 +00:00Commented May 26, 2021 at 17:59
-
solution : !pip uninstall keras-nightly /// pip uninstall -y tensorflow //// !pip install h5py==2.10.0nada belhadjslimen– nada belhadjslimen2021-05-28 08:25:58 +00:00Commented May 28, 2021 at 8:25
Add a comment
|
1 Answer
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.0Followed by fresh installation of tensorflow and keras as per requirement has solved the problem (paraphrased from nada belhadjslimen)