Problems in week1 assignment2

I wrote this in convolutional_model function according to the direction, but there was something goes wrong and I failed to figure it out by myself. Please help me debug :frowning:

{mentor edit: code removed}

this module warns:
AttributeError: ‘Flatten’ object has no attribute ‘shape’

but I do not understand!

This part of the assignment uses the Functional model. So you have to specify the data you want to use in each layer.

In your code you only specified the data in two of the layers (Z1 and outputs)

Please don’t post your code on the Forum. That’s not allowed by the Honor Code. I have edited your post.

I’m sorry! But how can I let you know what’s wrong with my code without posting it?

And I have solved this problem! Thanks for your help!

Describe the problem.
Post any assert messages.
Don’t post your code unless a mentor asks you to.

Tom has already pointed out the problem here, but maybe it’s also worth pointing to this Discourse post which is a much more complete introduction to the Sequential and Functional APIs than what they give us in the notebooks.