Deepdream python脚本不显示图像

Deepdream python脚本不显示图像,python,python-imaging-library,caffe,deep-dream,Python,Python Imaging Library,Caffe,Deep Dream,我一直跟着导游一直到晚上 _=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.Im

我一直跟着导游一直到晚上

_=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)
但它与指南提供的代码不兼容。唯一奇怪的是,当我使用f.getvalue()打印f(StringIO)时,它包含“垃圾”

有没有关于为什么不显示图像的见解

编辑: 如果我更改行(在showarray方法中)

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

编辑2: 换线

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

显示图像。现在的问题是我无法关闭它,因此它会在其他行的顶部显示一个。

更改行

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

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

im = PIL.Image.open('/home/jose/Downloads/deepdream/test')
display(Image(data=f.getvalue()))
im = PIL.Image.open('/home/jose/Downloads/deepdream/test')