Unable to Edit Code Cell in Week 1 CNN Lab – Input for happyModel() Not Registered

  • Week # must be added in the tags option of the post.
    week1

  • Description (include relevant info but please do not post solution code or your entire notebook)

Issue:
I need to add input to happyModel(input here), but I’m unable to edit the code in the original code cell in the Jupyter notebook—it’s locked. So, I created a new code cell and typed my answer there. All the tests passed, but my grade is still only 50.

Code context (from the notebook):

python

CopyEdit

happy_model = happyModel()
# Print a summary for each layer
for layer in summary(happy_model):
    print(layer)

output = [['ZeroPadding2D', (None, 70, 70, 3), 0, ((3, 3), (3, 3))],
          ['Conv2D', (None, 64, 64, 32), 4736, 'valid', 'linear', 'GlorotUniform'],
          ['BatchNormalization', (None, 64, 64, 32), 128],
          ['ReLU', (None, 64, 64, 32), 0],
          ['MaxPooling2D', (None, 32, 32, 32), 0, (2, 2), (2, 2), 'valid'],
          ['Flatten', (None, 32768), 0],
          ['Dense', (None, 1), 32769, 'sigmoid']]

comparator(summary(happy_model), output)

Any help on how to properly input the model so it registers for grading would be appreciated!

You can include the definition of the input as layers in your Sequential model definition. You should not need to add any cells to the notebook. But I did not have to define the input within happyModel in order for my code to succeed.

So I think this says that there is something else still wrong with your code.

One thing to try would be to remove your added cell and then show us the actual error message that you get in that case. Perhaps that might shed some light on the nature of the problem.

Cells are locked because they contain tests for your code. You do not need to modify those cells. They are already correct.

If a test cell throws an error, it’s because your code in one of the functions you modified doesn’t work correctly.

This is a very bad idea. Never add cells to a notebook. Instead, fix your code so that it passes the tests.

Adding cells is almost certain to make the grader crash and throw very confusing errors.

Tips:

  • Do not move, delete, or add any cells to the notebook.
  • Only modify the cells that are marked for grading, and then only in the marked areas for your code.
  • Do not rename your notebook.