1
7
问题所以基本上这里发生的是你在玩三种不同格式的图片(至少那些出现在你的问题中的)。它们分别是: 您看到的第三个维度是表示图像中的通道数(前两个分别是高度和宽度)。 一个例子将进一步澄清这一点。我从网上随机下载了属于上述三种格式之一的图片。
RGB-A图像
灰度图像
下面是一个python脚本,使用
因此,当您试图迭代地将所有图像分配给一个数组时(
解决方案
解决此问题的最简单方法是在将所有图像保存到数组中之前将其转换为一种特定格式。假设您将使用预先训练的ImageNet模型,我们将把它们转换为
我们会改变
输出为:
三
注意
希望这能澄清你的疑问。 |
bz_jf · CNN训练损失太不稳定了 2 年前 |
Elia · TF |培训结束后如何从CNN预测 6 年前 |
Cameron Blake · 基于Keras的误差多分类神经网络 6 年前 |
mcanizo · keras conv1d输入数据重塑 6 年前 |
batuman · Google Net的感受野计算 6 年前 |