Week 2 Assignment 1, Exercise 3--Resnet50 error

I am getting the following error. I’m pretty sure I’m following the recommended code order, but I do not understand how the outputs are different.

Test failed 
 Expected value 

 ['Add', (None, 15, 15, 256), 0] 

 does not match the input value: 

 ['TensorFlowOpLayer', [(None, 15, 15, 256)], 0]
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-20-58a17f1e219d> in <module>
      3 model = ResNet50(input_shape = (64, 64, 3), classes = 6)
      4 
----> 5 comparator(summary(model), ResNet50_summary)

/tf/W2A1/test_utils.py in comparator(learner, instructor)
     21                   "\n\n does not match the input value: \n\n",
     22                   colored(f"{a}", "red"))
---> 23             raise AssertionError("Error in test")
     24     print(colored("All tests passed!", "green"))
     25 

AssertionError: Error in test

It looks like you must used a different function to do the addition operation than what the instructions told you to do. They give you an example in the instructions for the identity_block for how to do it and then that logic is actually part of the template code in convolutional_block. You can literally copy it from the second function.

I am facing the same issue and I just simply copied the command from the step 2 block :frowning:

@Chitoooo: Please show us the complete error output that you got as srkrish2 did earlier.


Thanks for your reply, this is the error that I got.

Ok, that is not the same error that srkrish reported. So there is something wrong with the way you are specifying the ReLU activation. It needs to be a Keras Layer function. I suggest you read the instructions again more carefully and scan around to see if the template code shows you any examples of ReLU.

Thank you for your help! Now my code works!

1 Like

That’s great! I’m glad to hear you found the solution.