Error in Course 4 Week 2 Alpaca assignment

Hi, I am getting this error in the second exercise of this assignment.

TypeError Traceback (most recent call last)
----> 1 model2 = alpaca_model(IMG_SIZE, data_augmentation)

in alpaca_model(image_shape, data_augmentation)
—> 48 outputs = prediction_layer(x)
49 model = tf.keras.Model(inputs, outputs)

TypeError: ‘Tensor’ object is not callable

I tried searching the error up online, but the solutions just went over my head. Any help is appreciated. Thanks

Did you define a function called “prediction_layer()”? Because that’s what your code says to use.
You are supposed to use a Dense() layer there,.

yes i have a line in my code that defines prediction_layer = tfl.Dense(1)(x)

Then why are you passing ‘x’ to it again?

The expectation is that you’re going to use this:
outputs = tfl.Dense(1)(x)

1 Like

ohhh ok it worked i removed the (x) part. thanks for your help!

Don’t know bro how to thank you
I was stucked for a while over here