2017-02-14 39 views
0

我按照在Link引导直到Deepdream Python脚本未示出的图像

_=deepdream(net, img) 

步骤。现在它运行没有错误,但它不显示图像。这是输出:

<IPython.core.display.Image object> 
0 0 inception_4c/output (210, 373, 3) 
<IPython.core.display.Image object> 
0 1 inception_4c/output (210, 373, 3) 
<IPython.core.display.Image object> 
0 2 inception_4c/output (210, 373, 3) 

它继续进行类似的输出。

我可以给这个代码的文件:

im = PIL.Image.open('sky1024px.jpg') 
im.show() 

不过,这并不与该指南提供的代码工作。唯一看起来很奇怪的是,当我使用f.getvalue()打印时,f(StringIO)包含“垃圾”。

任何洞察力为什么它不显示图像?

编辑: 如果我改变行(showarray法)

PIL.Image.fromarray(a).save(f, fmt) 

PIL.Image.fromarray(a).save('/home/jose/Downloads/deepdream/test', fmt) 

它不显示图像,但至少它是将其保存在指定文件夹。

编辑2: 改变线

display(Image(data=f.getvalue())) 

im = PIL.Image.open('/home/jose/Downloads/deepdream/test') 

示出了图像。现在的问题是,我无法关闭它,因此它显示了一个在其他人之上。

回答

0

改变线

display(Image(data=f.getvalue())) 

im = PIL.Image.open('/home/jose/Downloads/deepdream/test') 

示出了图像。现在的问题是,我无法关闭它,因此它显示了一个在其他人之上。