【发布时间】:2020-10-09 02:57:07
【问题描述】:
我正在尝试导入 MNIST 数据集并仅使用 Holoviews 显示它。当我运行以下命令时:
import holoviews as hv
from torchvision import datasets, transforms
hv.extension('bokeh')
mnist_images = datasets.MNIST('data', train=True, download=True)
image_list = []
for k, (image, label) in enumerate(mnist_images):
if k >= 18:
break
image.show()
bounds = (0,0,1,1)
temp = hv.Image(image, bounds=bounds)
image_list.append(temp)
layout = hv.Layout(image_list).cols(2)
layout
我在 'temp = hv.Image(...)' 的行收到以下错误:
holoviews.core.data.interface.DataError: None of the available storage backends were able to support the supplied data format.
“image”变量是以下对象:image.show() 正确渲染图像。另外,如果我使用 matplotlib 的.imshow(),我可以获得正确的渲染。
我想要看到在 Holoviews 中呈现的图像,我希望 Holoviews.Image() 会这样做。这不是一个正确的假设吗?如果是,那么代码/方法有什么问题?
【问题讨论】: