Program terminated with status: 1. stderr follows

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 ‘’

1个回答

syntax error in line 1 near
第一行附近语法错误,不给代码可怎么看

weixin_44967421
阿君君君 首先非常感谢你宝贵的时间来回答这个问题,这些问题都很奇怪,那个文件夹应该是自动生成的
5 个月之前 回复
weixin_44967421
阿君君君 这个文件夹里(~Local\Temp\tmpx6oir6n9)只有这么一行语句:digraph G { }
5 个月之前 回复
weixin_44967421
阿君君君 这个文件夹里(~Local\Temp\tmpx6oir6n9)只有这么一行语句:digraph G { }
5 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问