Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get back to default tensorflow version on google colab

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 ?

like image 706
vinzee Avatar asked Apr 05 '18 16:04

vinzee


People also ask

Where is TensorFlow version in Colab?

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 .

How do I remove TensorFlow from Google Colab?

I uninstalled the pre-installed version of Tensorflow on Google Colab by using !pip uninstall tensorflow -y and then !pip uninstall tensorflow-gpu -y .


1 Answers

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.

like image 142
vinzee Avatar answered Oct 19 '22 02:10

vinzee