ValueError:找到的数组为暗4。估计量应为<= 2.怎么办?

问题描述 投票:1回答:1

我已经从目录中加载了一些图像数据集,并希望对这些图像进行分类。我已将其调整为(64,64,3)个尺寸的图像,但无法放入模型中。

它说:ValueError:找到的数组为暗4。估计量应小于等于2。应该怎么做?

image model dataset dimension valueerror
1个回答
0
投票

比方说,X是您的训练数据,其形状为(N_samples,64,64,3)Found array with dim 4表示您的图像具有上面显示的形状。

N_samples, img_width, img_height, ch = X.shape
X_reshaped = X.reshape(N_samples, -1 )

在这里做工作

© www.soinside.com 2019 - 2024. All rights reserved.