无法将大小为1的数组重塑为形状(1,224,224,3)

时间:2019-02-08 10:02:42

标签: python arrays numpy image-processing

我正在尝试将每个Y-U-V的三个分量的单独数组重塑为YUV数组。此数组输入的大小为64x64,然后将其大小调整为224x224。我应该如何正确做?

这是我在训练CNN网络之前输入的数据。因此,以下是我使用它的方法。

orgY = np.loadtxt(path)
orgU = np.loadtxt(path)
orgV = np.loadtxt(path)

originalYUV = np.dstack((orgY, orgU, orgV))

originalYUV = array(originalYUV).reshape(1, 224, 224, 3)

当我运行它时,这向我显示:ValueError:无法将大小为1的数组重塑为形状(1,224,224,3)。我应该如何解决?恐怕我使用np.dstack时代码错误,因为我什至无法调用width = originalYUV.shape[0]

0 个答案:

没有答案