Wk2 MobileNet Error from course provided code

Hello, I was working on the Wk2 Transfer Learning with MobileNet Notebook’s Section 3.2 Layer Freezing with the Functional API and I received an error from the program on code that I didn’t write but was provided within the notebook by DeepLearning.AI.

The error came from this section below,

With the following comment:
ValueError: logits and labels must have the same shape ((None, 1280) vs (None, 1))

Could someone help me fix this please?

Thank you!

There is an error in your alpaca_model() code.

Hello sorry about that.

I’ve been hunting for the source of the error, but I haven’t been able to find the differing logits and label shapes.

Below is a screenshot of my alpaca_model() code, could it be possible for you to help me please?
My code passed the previous task (the grader comparing my model summary with the answer), which was correct.

Thank you!

You’re using the wrong function for data augmentation.
Your prediction layer “outputs” should use a Dense layer.

Ah I fixed it! Thank you!