C4_Wk3_Ex2 Getting "does not match the input value"

Test failed 
 Expected value 

 ['Conv2D', (None, 12, 16, 256), 1179904, 'same', 'relu', 'HeNormal'] 

 does not match the input value: 

 ['Conv2D', (None, 12, 16, 32), 147488, 'same', 'relu', 'HeNormal']
---------------------------------------------------------------------------

My code seems to be correct:

{moderator edit - solution code removed}

The code you show looks correct, I think. You left out the logic for conv9, but I think the error is being thrown before you hit that code. If you compare your output to the full “expected” output, it looks like the error is on the output of the first upsampling block. Your arguments there look correct, so are you sure your upsampling_block code passes the test cases?

One other thing to try is to make sure that the state of your notebook is consistent, meaning that the code you see is what is actually being executed. Try this:

  1. Kernel → Restart and Clear Output
  2. Save
  3. Cell → Run All

Then carefully page through and check all the results.

Yep unsampling code block passes -
code:
{Moderator Edit: Solution Code Removed}
output:
Block 1:
[‘InputLayer’, [(None, 12, 16, 256)], 0]
[‘Conv2DTranspose’, (None, 24, 32, 32), 73760]
[‘InputLayer’, [(None, 24, 32, 128)], 0]
[‘Concatenate’, (None, 24, 32, 160), 0]
[‘Conv2D’, (None, 24, 32, 32), 46112, ‘same’, ‘relu’, ‘HeNormal’]
[‘Conv2D’, (None, 24, 32, 32), 9248, ‘same’, ‘relu’, ‘HeNormal’]
All tests passed!

And the conv 9 block:

{Moderator Edit: Solution Code Removed}

You hard-coded the number of filters to 32. It shouldn’t be that. The purpose is to write the general code which can work for any number of filters.

PS: Sharing your code in a public thread is not allowed by the community code of conduct. Please avaoid sharing your code.

Interesting. So that’s the classic example of a form of hard-coding that happens to pass the test case for that cell, but then fails later. In this case I guess you could say that we’re lucky in that it fails later in the notebook itself instead of failing in the grader, which is usually harder to debug.