NameError: name 'input_shape' is not defined, while creating Sequential model in keras

NameError: name 'input_shape' is not defined, while creating Sequential model in keras

我正在尝试在 Keras 中构建顺序模型,但在编译模型时出现此错误,我该如何解决?

# Step 3: Model Creation
model = Sequential()
model.add(Conv2D(32, (3,3), Input_shape(32, 32, 3),  padding = "same", activation = 'relu',
                 kernel_constraint = maxnorm(3)))
model.add(Dropout(0.2))
model.add(MaxPooling2D(pool_size=(2,2)))
 
model.add(Flatten())
model.add(Dense(512, activation = 'relu',kernel_constraint=maxnorm(3)))
model.add(Dropout(0.5))
model.add(Dense(num_classes,activation='relu'))

#Configure the optimizer
sgd = SGD(lr = 0.01, momentum =0.9, decay = (0.01/25),nesterov = False)

#compile the model
model.compile(loss = 'categorical_crossentropy',optimizer = sgd, metrics = ['accuracy'])

这是我遇到的错误:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-32-c2c434db6c57> in <module>()
      1 # Step 3: Model Creation
      2 model = Sequential()
----> 3 model.add(Conv2D(32, (3,3), Input_shape(32, 32, 3),  padding = "same", activation = 'relu',
      4                  kernel_constraint = maxnorm(3)))
      5 model.add(Dropout(0.2))

NameError: name 'Input_shape' is not defined

您缺少 = 符号:model.add()

的第 3 行中的 Input_shape = (32, 32, 3)