I did not know that tensorflow
and keras
were installed by default on the machine used by Google Colab. And I installed my own versions. But it was buggy. So I decided to go back to the previous versions. I did:
!pip install tensorflow==1.6.0
and
!pip install keras==2.1.5
But now, when I do import keras
, I get the following error:
AttributeError: module 'tensorflow' has no attribute 'name_scope'
Nota:
I asked a friend to know the default tensorflow
and keras
versions, and he gave me these:
!pip show tensorflow # 1.6.0
!pip show keras # 2.1.5
So I suspect, my installations were wrong somehow. What can I do so I can import keras
again ?
To check your TensorFlow version in your Jupyter Notebook such as Google's Colab, use the following two commands: import tensorflow as tf This imports the TensorFlow library and stores it in the variable named tf . print(tf. __version__) This prints the installed TensorFlow version number in the format x.y.z .
I uninstalled the pre-installed version of Tensorflow on Google Colab by using !pip uninstall tensorflow -y and then !pip uninstall tensorflow-gpu -y .
To get back to the default versions, I had to restart the VM.
To do so, just do:
!kill -9 -1
Then, wait 30 seconds, and reconnect.
I got the information by opening an issue on the github repository.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With