博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
使用keras时出现 `pydot` failed to call GraphViz的解决办法
阅读量:6803 次
发布时间:2019-06-26

本文共 2551 字,大约阅读时间需要 8 分钟。

问题来源于使用了 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 
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,问题解决。

转载于:https://www.cnblogs.com/hutao722/p/9552246.html

你可能感兴趣的文章
mysql基础知识之增删查改使用介绍
查看>>
C++11 提升Vector效能的技巧
查看>>
Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask.
查看>>
docker使用指南
查看>>
如何让对方发给你需要的文件格式?
查看>>
php学习笔记--运算符号
查看>>
IPv6已分配地址中国仅占0.29%
查看>>
解决Lync2010和Lync2013转接电话断开的问题
查看>>
find grep wc awk sed sort uniq split指令详解
查看>>
高并发中的卡死状态 -HashMap
查看>>
http上传文件深度解析-高性能http传输
查看>>
Linux下配置Java环境变量
查看>>
HTTP State Management Mechanism(HTTP 状态管理机制)
查看>>
IOS之禁用UIWebView的默认交互行为
查看>>
绩效管理功能扩展包
查看>>
我的友情链接
查看>>
Android:NDK、JNI
查看>>
dl,dt,dd标记在网页中要充分利用
查看>>
Oracle非常规恢复(使用BBED跳过归档)
查看>>
c# 的四舍五入
查看>>