Conv nn app/convolutional_model

need help my codes produce errors, posts do not help me
ValueError Traceback (most recent call last)
Cell In[34], line 1
----> 1 conv_model = convolutional_model((64, 64, 3))
2 conv_model.compile(optimizer=‘adam’,
3 loss=‘categorical_crossentropy’,
4 metrics=[‘accuracy’])
5 conv_model.summary()

Cell In[33], line 45, in convolutional_model(input_shape)
43 outputs=tfl.Dense(6,activation=‘softmax’)
—> 45 model = tf.keras.Model(inputs=input_img, outputs=outputs)
46 return model

Hi @FViloria ,
Please note that we have a Sequential Model example and a Functional API example. In both cases, the way to pass from one layer to another is a bit different. Please make sure not to use a syntax from one to another.
Keep learning!

1 Like

Did you post the entire error message? It seems there should be more information there.
A screen capture image is preferred.

In your “Z1 = …” code:

  • “filters” should be an integer. Yours is a tuple, that’s why the error message about “tuple and int”.
    The kernel size can be either a tuple or a list.

  • Also check whether you have the correct filters and kernel size values.

Thank you Tom, corrected, but the output is wrong

The values I’ve flagged here are incorrect:


Check the parameters you are passing to those layers.

Thank you Tom, i fixed it, all test passed