C4W1A2_Ex2:tfl.Dense

It has error in Test, I can’t find it. Please give me a hand, I stucked for long time.


If you’re using the Sequential model, you have to define the layers as a comma-separated list, enclosed by square brackets. But you don’t have to specify the data flow at each layer.

If you’re using the Functional model, you have to pass the data to each layer by enclosing it in another set of parenthesis, immediately after the layer definition.

The way you wrote your code, you’re defining the input_img, then you have a lot of lines of code that are ignored (because you didn’t pass them any data), and you then pass input_img directly to the Dense output layer.

I’ve already figured out.
This helps me a lot. Thank you.