DLS Course 4 Week 1

Although i have made the model for sequential api with all tests passed but in very next step when i try to fit that model for happy_model.fit() it doesn’t work, gives the error:

logits and labels must have the same shape ((None, 1) vs (None, 6))

Can someone please guide me through this?

In your happyModel function, did you made sure that your Dense layer has a single neuron only, and not 6 neurons?

Thankyou for response,
Yes I have used 1 only

Remove the comma after the end of the “Dense(…)” statement.

Then please edit your reply to remove the code - to respect the course Honor Code.

In the zero padding layer, you also need to define the input_shape.

when i fit the model using model.fit() it gives me error: logits and labels must have the same shape ((None, 1) vs (None, 6))
I am getting model summary but not able to fit.
Could you please guide me through this?

What did you use for the shape in the zero padding layer?

input_shape = (64, 64, 3)
used in :
tfl.ZeroPadding2D(padding=3,input_shape = input_shape),

1 Like

Yes it is already like this
tfl.Dense(1, activation=‘sigmoid’)