DLS C4 W2 A1 Ex3

in Exercise 3 - ResNet50, I receive a Test failed error although I checked my code many times.

The complete error is as follows:

Test failed
Expected value

[‘Add’, (None, 15, 15, 256), 0]

does not match the input value:

[‘TensorFlowOpLayer’, [(None, 15, 15, 256)], 0]

Please help me fix it.

There are multiple equivalent ways to express an “Add” layer. They want you to do it in a very specific way, which they described in the instructions. Please have another look.

Thank you for replying,

I have used the “Add” layer in Ex2 (convolutional_block) and it worked fine. In this exercise, the last line of code is average pooling. As required in the comments:
AVGPOOL (≈1 line). Use “X = AveragePooling2D(…)(X)”

There is no other step that I could have missed. The order of “Add” in Ex2 is also correct. I have seen in other people’s questions that some of them may have had it wrong.

Do you mean that you fixed the “Add” layer and now you get a different error to do with AveragePooling? If so, please show us the new error output that you are seeing.

If you’re saying that you still get the same error as before, then did you actually read the instructions again about how the Add layer is supposed to look? They wrote it out for you in the instructions.

Thanks!

The problem was actually in the “Add” layer for identity_block. I’ve only been checking the convolutional_block and totally disregarded checking the identity_block too.

It’s great to hear that you found the solution. Thanks for confirming.