如何将不同大小的输入插入卷积神经网络?

时间:2019-03-22 23:49:24

标签: python keras

我有一个列表,其中包含5张不同大小的图像,我想将它们传递给卷积神经网络,如下所示:

enter image description here

但是由于网络大小不同,我会收到以下错误消息:

ValueError: Error when checking model input: the list of Numpy arrays that you are passing to your model is not the size the model expected. Expected to see 1 array(s), but instead got the following list of 5 arrays

因为我无法将图像传递为keras格式:

x = np.array(x, dtype=np.uint8)
x = x.reshape(x.shape[0],x.shape[1],x.shape[2],3)

有人知道我如何在不调整图像大小的情况下将具有不同尺寸的图像列表传递给keras格式吗?

0 个答案:

没有答案