【发布时间】:2020-01-10 13:26:15
【问题描述】:
我有一个多维数组(11, 28, 28),它由 11 个图像组成,每个图像有 28*28 像素。
x_train_new_reshaped[0].shape
Out[8]: (11, 28, 28)
如何一次显示它们?
这会导致:
In:
image = x_train_new_reshaped[0]
plt.figure()
plt.imshow(image)
plt.show()
Out:
TypeError: Invalid dimensions for image data
这也是:
In:
image = np.squeeze(x_train_new_reshaped[0])
plt.figure()
plt.imshow(image)
plt.show()
Out:
TypeError: Invalid dimensions for image data
感谢任何帮助。
【问题讨论】:
标签: python arrays multidimensional-array display mnist