Error when checking model input: expected convolution2d_input_1 to have 4 dimensions, but got array with shape (32, 32, 3)

后端 未结 9 1682
南笙
南笙 2020-12-08 01:28

I want to train a deep network starting with the following layer:

model = Sequential()
model.add(Conv2D(32, 3, 3, input_shape=(32, 32, 3)))

9条回答
  •  鱼传尺愫
    2020-12-08 02:18

    Got the same problem, non of the answers worked for me. After a lot of debugging I found out that the size of one image was smaller than 32. This leads to a broken array with wrong dimensions and the above mentioned error.

    To solve the problem, make sure that all images have the correct dimensions.

提交回复
热议问题