如何卸载Keras?

问题描述 投票:15回答:9

我使用此命令安装了Keras:

sudo pip install keras

它正确安装并正常工作,直到我尝试导入应用程序模块:

from keras.applications.vgg16 import VGG16
Using Theano backend.
Couldn't import dot_parser, loading of dot files will not be possible.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named applications.vgg16

我遇到this link which recommends卸载Keras并直接从GitHub安装Keras:

sudo pip install git+https://github.com/fchollet/keras.git

在从GitHub重新安装Keras之前,我试图使用此命令取消对Keras的解除,但它会抛出此错误:

sudo pip uninstall keras
Can't uninstall 'Keras'. No files were found to uninstall.
python theano keras
9个回答
8
投票

您只需尝试以下命令:

pip uninstall keras

6
投票

我跟着this method来解决我的问题

>> import keras
>> keras.__path__
['/usr/local/lib/python2.7/dist-packages/keras']

#copy the path
>> sudo  rm -r /usr/local/lib/python2.7/dist-packages/keras

#re installation
>> sudo pip install git+https://github.com/fchollet/keras.git

4
投票

硬卸载:

pip uninstall keras -y                                                                                                                                                                            

重新安装特定版本

pip install -Iv keras==2.1.4 

1
投票

我想你真的想做的不是卸载keras,而是使用keras.applications.vgg16。 以下清单将帮助您澄清问题。

  • Keras版本:确认keras的版本是最新的(现在2.0.5)
  • 后端:Theano / Tensorflow或其他
  • 设备:GPU或CPU
  • Python版本:2或3并使用或不使用Anaconda
  • 操作系统:Mac,Windows,Linux等

我建议首先检查最新的keras,TensorFlow后端(CPU模式),Python3设置。它将解决各种问题。


0
投票

你可以用 sudo pip -U install keras 做到这一点


0
投票

如果您使用任何环境,请查看Anaconda环境


0
投票

在Anaconda提示类型

conda uninstall keras

0
投票

您可以使用此命令从conda卸载。 conda uninstall keras


0
投票

试试这个:

sudo pip uninstall git+https://github.com/fchollet/keras.git

如果这不起作用,你可以在sudo pip list之后看到什么?

© www.soinside.com 2019 - 2024. All rights reserved.