我看到了类似的问题,但也没有解决,所以我决定问一下。
我正在尝试使用Keras可视化我的模型。
from keras.utils import plot_model
plot_model(model, to_file='model.png')
首先,它显示了错误。
ImportError: Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work.
因此,我通过Anaconda提示符安装了pydot和graphviz,并在激活我的环境后进行了安装。
conda install -c https://conda.binstar.org/t/TOKEN/j14r pydot
conda install -c https://conda.binstar.org/t/TOKEN/j14r graphviz
然后,我关闭了 Spyder 并重新打开了它。当我运行代码片段时,仍然显示相同的错误。 我错过了什么吗?