Hi,

there is something strange with the first graded exercise of “Convolutional Neural Networks: Application”. If I do not put any code in “# GRADED FUNCTION: happyModel” the next cell gives “All tests passed!” and I get 50 grades too.

Henrikh

Hi,

there is something strange with the first graded exercise of “Convolutional Neural Networks: Application”. If I do not put any code in “# GRADED FUNCTION: happyModel” the next cell gives “All tests passed!” and I get 50 grades too.

Henrikh

Interesting. Yes, it turns out there is a bug in the comparator function used by the test case there. It does not check that the length of the two inputs are the same and that turns out to pass if your input is shorter, but agrees as far as it goes. In your case, if it’s empty, that passes. Sigh. We’ve filed this bug against other variants of this function used in other exercises, but this one fell through the cracks. Sigh. I’ll file a new bug about this. Thanks for pointing this out.

1 Like

I am happy to be of help!

Also, if only first layer - ZeroPadding in model = tf.keras.Sequential() is with the right parameters I get “All tests passed!” and 50 grades. I think this is related to what you mentioned about the lengths of two inputs.

Henrikh

Right! You can see the bug if you inspect the code for the *comparator* function. It is in the file test_utils.py. Here are the first few lines:

```
# Compare the two inputs
def comparator(learner, instructor):
for a, b in zip(learner, instructor):
if tuple(a) != tuple(b):
```

It turns out that the semantics of that “zip” are that the loop quits when it hits the last entry of either operand. So the comparison stops when it hits the end of either one. The fix is to first add a check that both lists have the same length.

1 Like