我有一个灰度图像作为形状为(256,256,1)的数组,我想将其展平为形状(65536,)。
我尝试使用 reshape 、 flatten 和 ravel 但没有任何效果。
我也看了这个答案
但我不太了解解决方案,因为我是 python 的初学者。
我该如何解决这个问题?
编辑:
这是导致问题的代码行
image_width = image_height = 256 X[0] = np.reshape(X[0],(image_width*image_height))
其中 X 具有以下形状:(64, 256, 256, 1)
数组的 dtype 是float32
30秒到达战场
相关分类