Course 04 W02 "Residual Network" programming assignment ISSUE

Can someone please help me passing the assignment because it always throws an error


We can’t completely see the exception traces in the screenshots you show, but it looks like you are seeing problems in the convolutional_block function first and then when you call it as well. My suggestion would be to concentrate on the earlier problem first.

From what we can see of your convolutional_block function, it does not look correct. There should be a call to BatchNormalization where the first “relu” activation shows up in the image you showed us (right before the “END CODE HERE”).

1 Like

1*/this is the code (exercise 02 “convolutional_block”)


1**/ this is the issue

2*/this is the code (exercise 03 “ResNet50”)

2**/this is the issue

You have added two extra calls to Activation(“relu”) in the convolutional_block code that should not be there:

In the “Third component” and in the “shortcut path”. The point is those two outputs get added together first and then the “Relu” is applied after that in the template code that they gave you.

This was described in detail in the instructions for both this section and for the “identity block” section.

There is no point in trying to debug the later issues until you get convolutional_block to pass the test cases. It’s hopeless to get Resnet50 to work if convolutional_block is not correct yet.

Thank you very much sir , about the “convolutional_block” yes i added two extra “ReLUs”.
But regarding to the “ResNet50” it turned out that i should have import the package in order to be able to debug the code the thing that was not among the exercise’s tasks.
would you please consider this. Thank you in advance

That is a mistake: the import commands are already done by an earlier cell in the notebook, right? You should just execute that cell instead of duplicating the code. Just do “Cell → Run All Above” and then run your test again. Note that you must do that anytime you reopen or restart the notebook.

1 Like

Tip:
Do not add code to any cell outside of a “START CODE HERE” area.