[Week 2] Residual Nets/Exercise 2/ AssertionError

Hi I am getting this error

AssertionError                            Traceback (most recent call last)
<ipython-input-31-869d2d1d4c16> in <module>
     12 assert type(A) == EagerTensor, "Use only tensorflow and keras functions"
     13 assert tuple(tf.shape(A).numpy()) == (3, 2, 2, 6), "Wrong shape."
---> 14 assert np.allclose(A.numpy(), convolutional_block_output1), "Wrong values when training=False."
     15 print(A[0])
     16 

AssertionError: Wrong values when training=False.

I have checked the shortcut block, and I used ‘X_shortcut’ as input as I was supposed to do. I also made sure that in batch normalization I set training equal to training.
I can’t really figure out where is the problem, if anyone could help me, I’d be thankful.

You’ve posted in the wrong Forum area, ResNets are in C4.
I have moved your post to the C4 forum.

It sounds like you’ve checked the things that are usually the problem, but there are lots more details here that all need to be correct. E.g. the padding and stride and filter sizes everywhere. This assignment is basically an elaborate exercise in proofreading. :scream_cat:

Sorry, I didn’t realize that.

I found the error it turns out I didn’t do batch normalization in the third component, instead, for some reason, I added an activation layer :grinning: .

Nice work! It’s great to hear that you found the solution on your own power. Thanks for confirming.

1 Like