gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-28 19:00:54 29 4
gpt4 key购买 nike

我正在尝试在 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/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com