python - 如何在 google colab 上安装 pydot 和 graphviz?

标签 python keras graphviz google-colaboratory pydot

我正在尝试在 google colab 上绘制我的模型。

 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.

我已经安装了 pydot-nggraphviz 但我仍然无法解决这个错误。

最佳答案

要安装 pydot,请运行:

!pip install -q pydot

然后,重新启动您的 VM 以重新加载 keras,然后它应该会检测到 pydot 的存在。 (运行时菜单 -> 重启运行时...)

关于python - 如何在 google colab 上安装 pydot 和 graphviz?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52756389/

相关文章:

带有 map_async 的 python 多处理池

python - 使用分页从 FB 广告 API 检索异步广告洞察结果

python - 在Python中的元组内将String元素转换为int

python - Tensorflow Keras 模型 : how to get the best score from a history object

python - 我需要 Keras VGG16 的预训练权重吗?

Graphviz子图顺序

Python Selenium webdriver 查询

python - keras 中 softmax 输出的一个热输入

java - 从 Java 应用程序创建带有下标的 Graphviz 标签

c - GraphViz 边缘标签