【Python】处理 pydotplus.graphviz.InvocationException: GraphViz’s executables not found

Python报错:

pydotplus.graphviz.InvocationException: GraphViz’s executables not found

解决方法是使用pip下载:

  • pip install pydotplus
  • pip install graphviz
已标记关键词 清除标记
# Program terminated with status: 1. stderr follows: Error: C:\Users\AppData\Local\Temp\tmpx6oir6n9: syntax error in line 1 near ‘’ 大家好:我正在做吴恩达老师第四课第二周练习一:Keras - Tutorial - Happy House 碰到了一个奇怪的问题,找了很久都不知道原因,望大家能帮忙找出原因,在下不胜感激。 ## 代码:(最后一个cell) plot_model(happyModel,to_file=‘HappyModel.png’) SVG(model_to_dot(happyModel).create(prog=‘dot’, format=‘svg’)) ## **错误:** InvocationException Traceback (most recent call last) in 6 #plot_model(happyModel,to_file=‘HappyModel.png’) 7 #plot_model(happyModel,to_file=‘E:/software/python/Jupyter/COURSE 4 Convolutional Neural Networks/Week 02/KerasTutorial/HappyModel.png’) ----> 8 plot_model(happyModel,to_file=‘HappyModel.png’) 9 SVG(model_to_dot(happyModel).create(prog=‘dot’, format=‘svg’)) 10 #import os E:\software\Anaconda\lib\site-packages\keras\utils\vis_utils.py in plot_model(model, to_file, show_shapes, show_layer_names, rankdir, expand_nested, dpi) 238 “”" 239 dot = model_to_dot(model, show_shapes, show_layer_names, rankdir, –> 240 expand_nested, dpi) 241 _, extension = os.path.splitext(to_file) 242 if not extension: E:\software\Anaconda\lib\site-packages\keras\utils\vis_utils.py in model_to_dot(model, show_shapes, show_layer_names, rankdir, expand_nested, dpi, subgraph) 77 from …models import Sequential 78 —> 79 _check_pydot() 80 if subgraph: 81 dot = pydot.Cluster(style=‘dashed’, graph_name=model.name) E:\software\Anaconda\lib\site-packages\keras\utils\vis_utils.py in _check_pydot() 26 # Attempt to create an image of a blank graph 27 # to check the pydot/graphviz installation. —> 28 pydot.Dot.create(pydot.Dot()) 29 except OSError: 30 raise OSError( E:\software\Anaconda\lib\site-packages\pydot_ng_init_.py in create(self, prog, format) 1889 raise InvocationException( 1890 ‘Program terminated with status: %d. stderr follows: %s’ % ( -> 1891 status, stderr_output)) 1892 elif stderr_output: 1893 print(stderr_output) **InvocationException: Program terminated with status: 1. stderr follows: Error: C:\Users\AppData\Local\Temp\tmpx6oir6n9: syntax error in line 1 near ‘’**
©️2020 CSDN 皮肤主题: 博客之星2020 设计师:CY__ 返回首页