简体   繁体   中英

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 ?

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM