如何在google colab上恢复默认的tensorflow版本

时间:2018-04-05 16:44:36

标签: python tensorflow keras google-colaboratory

我不知道默认情况下会在Google Colab使用的计算机上安装tensorflowkeras。我安装了自己的版本。但它是马车。所以我决定回到以前的版本。我做了:

!pip install tensorflow==1.6.0

!pip install keras==2.1.5

但现在,当我import keras时,我收到以下错误:

AttributeError: module 'tensorflow' has no attribute 'name_scope'

诺塔: 我让朋友知道默认的tensorflowkeras版本,他给了我这些:

!pip show tensorflow  # 1.6.0
!pip show keras  # 2.1.5

所以我怀疑,我的装置在某种程度上是错误的。我该怎么做才能再次导入keras

1 个答案:

答案 0 :(得分:2)

要恢复默认版本,我必须重新启动VM 为此,请执行以下操作:

!kill -9 -1

然后,等待30秒,然后重新连接。

我通过在github repository上打开一个问题来获取信息。