Week 1 assignment 2 sequential API 'type error"

Hello Mentors and fellow classmates I’ve been stuck on this trivial problem for a while now and I have gone through some similar questions here but my code seems to have none of the problems as stated can you please help me

{Moderator’s Edit: Solution Code Removed}

the error is : TypeError Traceback (most recent call last)
in
----> 1 happy_model = happyModel()
2 # Print a summary for each layer
3 for layer in summary(happy_model):
4 print(layer)
5

in happyModel()
30 tfl.Flatten,
31 ## Dense layer with 1 unit for output & ‘sigmoid’ activation
—> 32 tfl.Dense(1, activation = ‘sigmoid’)
33 # YOUR CODE STARTS HERE
34

## Max Pooling 2D with default parameters
tfl.MaxPool2D,
## Flatten layer
tfl.Flatten,

I guess the error is in these 2 lines of code. Your code piece doesn’t seem to instantiate the layers. Try replacing these with

tfl.MaxPool2D(),
tfl.Flatten(),

3 Likes

Including the () notation for the layers is important.

1 Like

why “max_value=1” ? What does this mean and is this necssary?

Hey @Doron_Modan,
I suppose to understand this argument, we don’t need to go any further than the documentation itself, which you can find here.

In this programming assignment, nowhere it has been instructed to use this argument with ReLU. I hope this helps.

Cheers,
Elemento