我在 Windows 10 上使用 Anaconda Python 2.7
我正计划进行 Keras 可视化,所以(当 spyder 打开时)我打开了 Anaconda 命令提示符并 pip 安装了 graphviz 和 pydot。现在,当我尝试运行以下命令时:
from keras.models import Sequential
或任何形式的“来自 keras”。,我得到错误:
ImportError: cannot import name gof
我已经卸载并重新安装了 Keras、Graphviz 和 pydot。我正在使用theano的开发版本。我找不到修复方法。
附言
如果我卸载 graphviz 和 pydot,keras 会再次工作
编辑
卸载 anaconda 并重新安装包括 theano、keras、graphviz 和 pydot 后,我现在收到以下错误:
from keras.utils.visualize_util import plot
Using Theano backend.
Using gpu device 0: GeForce GTX 970M (CNMeM is disabled, cuDNN not available)
Traceback (most recent call last):
File "<ipython-input-1-65016ddab3cd>", line 1, in <module>
from keras.utils.visualize_util import plot
File "C:\Anaconda2\lib\site-packages\keras\utils\visualize_util.py", line 8, in <module>
raise RuntimeError('Failed to import pydot. You must install pydot'
RuntimeError: Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work.
pip install graphviz
我用过pip install git+https://github.com/nlhepler/pydot.git