问题来源于使用了 keras.utils.plot_model,报错内容为:

2018-08-29 08:58:21.937037: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
/home/you/Documents/workspace/PycharmProjects/venv/lib/python3.6/site-packages/keras/engine/saving.py:269: UserWarning: No training configuration found in save file: the model was *not* compiled. Compile it manually.
warnings.warn('No training configuration found in save file: '
Traceback (most recent call last):
File "/home/you/Documents/workspace/PycharmProjects/venv/lib/python3.6/site-packages/pydot.py", line 1861, in create
stderr=subprocess.PIPE, stdout=subprocess.PIPE)
File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'dot': 'dot' During handling of the above exception, another exception occurred: Traceback (most recent call last):
File "/home/you/Documents/workspace/PycharmProjects/venv/lib/python3.6/site-packages/keras/utils/vis_utils.py", line 26, in _check_pydot
pydot.Dot.create(pydot.Dot())
File "/home/you/Documents/workspace/PycharmProjects/venv/lib/python3.6/site-packages/pydot.py", line 1867, in create
raise OSError(*args)
FileNotFoundError: [Errno 2] "dot" not found in path. During handling of the above exception, another exception occurred: Traceback (most recent call last):
File "/home/you/Documents/workspace/PycharmProjects/venv/src/test.py", line 8, in <module>
plot_model(model, to_file=MODEL_PNG)
File "/home/you/Documents/workspace/PycharmProjects/venv/lib/python3.6/site-packages/keras/utils/vis_utils.py", line 132, in plot_model
dot = model_to_dot(model, show_shapes, show_layer_names, rankdir)
File "/home/you/Documents/workspace/PycharmProjects/venv/lib/python3.6/site-packages/keras/utils/vis_utils.py", line 55, in model_to_dot
_check_pydot()
File "/home/you/Documents/workspace/PycharmProjects/venv/lib/python3.6/site-packages/keras/utils/vis_utils.py", line 29, in _check_pydot
'`pydot` failed to call GraphViz.'
OSError: `pydot` failed to call GraphViz.Please install GraphViz (https://www.graphviz.org/) and ensure that its executables are in the $PATH. Process finished with exit code 1

  第一反应是pip3 install graphviz,但安装完后依然不好使。

后来查官网可以使用apt install graphviz,问题解决。

使用keras时出现 `pydot` failed to call GraphViz的解决办法的更多相关文章

  1. Ubuntu pydot failed to call GraphViz.Please install GraphViz 解决方法

    如果遇到: OSError: `pydot` failed to call GraphViz.Please install GraphViz (https://www.graphviz.org/) a ...

  2. Android SDK安装时出错“android Failed to rename directory”的解决方法

    Android SDK安装时出错"android Failed to rename directory"的解决的方法     安装Android SDK时遇到Failed to r ...

  3. JVM 崩溃 Failed to write core dump解决办法 WINDOWS

    JVM 崩溃 Failed to write core dump解决办法 WINDOWS MIT key words: JVM,崩溃,windows,Failed,core dump,虚拟内存 最近从 ...

  4. 关于jquery html()方法获取带有OBJECT标签的元素内容时,出现“类型不匹配。”的解决办法

    关于jquery html()方法获取带有OBJECT标签的元素内容时,出现“类型不匹配.”的解决办法 解决办法: $("selector").clone().html()

  5. PLSQL往Oracle数据库插入中文后变为问号 和 启动PLSQL时提示NLS_LANG在客户端不能确定的解决办法

    PLSQL往Oracle数据库插入中文后变为问号 和 启动PLSQL时提示NLS_LANG在客户端不能确定的解决办法 1.检查服务器的字符编码 Select * from V$NLS_PARAMETE ...

  6. @PathVariable出现点号"."时导致路径参数截断获取不全的解决办法

    @PathVariable出现点号"."时导致路径参数截断获取不全的解决办法 比如,我路径是/test/{name},name的值是1.2.3.4,后台用@PathVariable ...

  7. excel双击文件打开时空白,使用菜单打开正常的解决办法

    excel双击文件打开时空白,使用菜单打开正常的解决办法 打开 excel的选项 找到高级->常规 取消“忽略使用动态数据交换...”的勾,确定. 问题解决.

  8. WPF 在TextBox失去焦点时检测数据,出错重新获得焦点解决办法

    WPF 在TextBox失去焦点时检测数据,出错重新获得焦点解决办法 在WPF的TextBox的LostFocus事件中直接使用Focus()方法会出现死循环的问题 正确的使用方式有2中方法: 方法一 ...

  9. Vue微信自定义分享时安卓系统config:ok,ios系统config:invalid signature签名错误,或者安卓和ios二次分享时均config:ok但是分享无效的解决办法

    简述需求:要求指定页面可以进行微信自定义分享(自定义标题,描述,图片,链接),剩下的页面隐藏所有基础接口.二次分享依然可以正常使用,切换至其他页面也可以正常进行自定义分享. 这两天在做微信自定义分享的 ...

随机推荐

  1. web api 支持cors

    1. configservice //******************* cors start *********************** var urls = Configuration[S ...

  2. 【hdu3033】分组背包(每组最少选一个)

    [题意] 有S款运动鞋,一个n件,总钱数为m,求不超过总钱数且每款鞋子至少买一双的情况下,使价值最大.如果有一款买不到,就输出“Impossible". 1<=N<=100  1 ...

  3. 【NOIP】提高组2005 过河

    [算法]状态压缩型DP [题解] Q=tx+(t-1)y 对于Q≥t(t-1),x,y一定有解. 所以当两石子间距离long>t(t-1)时,令long=t(t-1),重新构造数组即可. [注意 ...

  4. 【BZOJ】3895: 取石子

    [算法]博弈论+记忆化搜索 [题意]给定n堆石子,两人轮流操作,每个人可以合并两堆石子或拿走一个石子,不能操作者输,问是否先手必胜 [题解] 首先,若所有石子堆的石子数>1,显然总操作数为(石子 ...

  5. 【51NOD】独木舟

    [算法]贪心 [题解]比较经典,用l,r两个定位指针分别从左右向中间推进. #include<cstdio> #include<algorithm> #include<c ...

  6. Frogs' Neighborhood(POJ1659+Havel-Hakimi定理)

    题目链接:http://poj.org/problem?id=1659 题目: 题意:根据他给你的每个点的度数构造一张无向图. 思路:自己WA了几发(好菜啊……)后看到discuss才知道这个要用Ha ...

  7. poj 2762 tarjan缩点+拓扑序

    2013-09-08 10:00 var m, n :longint; t :longint; f, last :..] of longint; pre, other :..] of longint; ...

  8. EditText中inputType详解

    <EditText Android:layout_width="fill_parent" android:layout_height="wrap_content&q ...

  9. Python3【模块】concurrent.futures模块,线程池进程池

    Python标准库为我们提供了threading和multiprocessing模块编写相应的多线程/多进程代码,但是当项目达到一定的规模,频繁创建/销毁进程或者线程是非常消耗资源的,这个时候我们就要 ...

  10. TCP之Nagle算法与延迟ACK

    (一)Nagle算法 为了减少网络中小分组的数目,减少网络拥塞的情况.Nagle算法要求在一条TCP连接上最多只能有一个未被确认的未完成小分组,在该分组ACK到达之前不能够发送其他的小分组,发送端需要 ...