C2_W1_Assignment Error - Wrong number of layers

I’m getting a traceback when submitting C2_W1_Assigment that states: “Cell #9. Can’t compile the student’s code. Error: AssertionError(‘Wrong number of layers. Expected 3 but got 0’)”

I believe the code is correct. If I run it in the Jupyter notebook I get 3 layers. I’ve seen others suggest removing the name attribute, but I get the same error after removing it. Any assistance would be appreciated!

Model: “my_model”


Layer (type) Output Shape Param #

layer1 (Dense) (None, 25) 10025

layer2 (Dense) (None, 15) 390

layer3 (Dense) (None, 1) 16

=================================================================
Total params: 10,431
Trainable params: 10,431
Non-trainable params: 0


Link to assignment:
{LINK REMOVED BY MODERATOR AS THE ASSIGNMENT WILL BE GRADING YOUR PROGRAMMING OR CODING SKILLS}

1 Like

Hello @Pogue_Mahone

Could you share the codes for the particular grader cell you are encountering the issue by personal DM. Click on my name and then message.

Also did you include name=“layer1” for each layer you used?

and by any chance, you removed the below statements from the grader cell? or edited codes which you were not suppose to!!!

UNQ_C1
GRADED CELL: Sequential model

Regards
DP

1 Like

Hi @Deepti_Prasad. Thanks for the response!

All good now. I think there was a bug with the notebook itself. When I went to retrieve the code to reply, I’d lost all my work despite manually saving several times. I redid the work and resubmitted, and am no longer receiving an error. :slight_smile:

3 Likes