Deep Neural Network Week 4-Assignment 3

Hi All,

I have been facing an issue in assignment submission. After going through similar topics I was able to solve the error in the code by removing extra cost variable in new line.
The main issue is that i cannot edit the below line to remove the costs as its showing locked. I have added new line with modified code and it worked. Still i am not able to pass the assignment due to below line which i cannot delete or remove from the code.

parameters, costs = L_layer_model(train_x, train_y, layers_dims, num_iterations = 1, print_cost = False)

print("Cost after first iteration: " + str(costs[0]))

L_layer_model_test(L_layer_model)

Please help me to resolve this problem. Thanks in advance.

Addition to this, I am getting below comments where its showing passes all test.

[ValidateApp | INFO] Validating ‘/home/jovyan/work/submitted/courseraLearner/W4A2/Deep Neural Network - Application.ipynb’
[ValidateApp | INFO] Executing notebook with kernel: python3
[ValidateApp | ERROR] Timeout waiting for execute reply (30s).
[ValidateApp | ERROR] Interrupting kernel
[ValidateApp | ERROR] Timeout waiting for execute reply (30s).
[ValidateApp | ERROR] Interrupting kernel
[ValidateApp | ERROR] Timeout waiting for execute reply (30s).
[ValidateApp | ERROR] Interrupting kernel
[ValidateApp | ERROR] Timeout waiting for execute reply (30s).
[ValidateApp | ERROR] Interrupting kernel
Success! Your notebook passes all the tests.

What could be the problem here? Please help

What do you mean “remove extra cost variable”? If you mean that your L_layer_model function returns only one return value, that means you have made a mistake. Either you mistakenly edited the template code that was given to you to remove the second return value or perhaps you “copy/pasted” the entire function from an earlier version of the course in which there was only one return value from that function. In either case, you need to fix your L_layer_model so that it has the correct two return values. The best way to do that would be to get a fresh copy of the notebook and then carefully “copy/paste” over just your completed code from the “YOUR CODE HERE” sections and don’t modify the given template code. There is a topic about how to do that on the FAQ Thread, q.v.

For future reference, please note that anytime you feel you need to change the given test code in order for things to work, that is the wrong approach. If the test is failing, that means your code is incorrect and you need to think harder to figure out what is wrong with your implementation rather than changing the test code.

1 Like

Thank you Paul for your reply.