Hello, I’m encountering an issue with the fourth exercise in C1_W3_Assignment. Although the code produces the expected output in the notebook, I face an error when attempting to test it. The error message reads: “forward_propagation() takes 2 positional arguments but 3 were given.” Here is the relevant code snippet for your reference. Any assistance in resolving this matter would be greatly appreciated.
Code
def forward_propagation(X, parameters):
“”"
Argument:
X – input data of size (n_x, m)
parameters – python dictionary containing your parameters (output of initialization function)
Returns:
Y_hat -- The output
"""
# Retrieve each parameter from the dictionary "parameters".
### START CODE HERE ### (~ 2 lines of code)
{Codes removed by Moderator} ### END CODE HERE ###
# Implement Forward Propagation to calculate Z.
### START CODE HERE ### (~ 2 lines of code)
{Codes removed by Moderator} ### END CODE HERE ###
even im facing the same issue. i tried @TMosh 's way of updating the notebook, still i encounter this frustrating issue. imo one of the worst experiences i had w/ a coursera course.
If you are following the method of getting a new copy of the notebook (i.e. delete your current notebook, then use “Help->Get latest version” to get a new notebook), then you will find that the new notebook uses three parameters for the forward_propagation() function.
You may also need to use “Kernel → Restart and clear output”
If you look at your notebook and see that forward_propagation() only takes two arguments, then you are still using an old copy of the notebook.
hello! i tried what is mentioned in topic 1b @Deepti_Prasad and @TMosh . but still the error preserves. is there another option of submitting my work and grade it? other courses i have done so far with lab exercises usually had another way of submitting my work other than the from the jupyter workspace. please help me in this, my deadline’s closing by.
I told you to use 1(a) topic if the 1(b) didn’t work, the difference between these two topic is 1(a) requires deletion of your assignment files and then rebooting, getting the latest version with Updating the lab. Please go through each step in 1(a)
Also to be on safer side, after you delete the assignment file, make sure you clear your browsing and cache history, log out of your coursera. Then re-login, go the assignment page before you do the rebooting and getting the latest version.
Let me know if after following 1(a) resolved your issue or not.
That’s ok. I am sharing a post where I guided the learner step wise on how to get the fresh copy, sharing the link, kindly go through all comments for better understanding.
yes im here. i did everything as you instructed ma’am. i even tried modifying the code of the unit test file it is the error message that im getting. i modified the unit test file with the “new” unit test file i found on a github repo. though i get “all test passed” this time unlike before, still when i submit my work auto grader still outputs the same error and i get 0 though my work is flawless.
i did what you have asked ma’am. i even deleted the folders and got the 404 page. and then i opened an incognito tab and accessed the assignment and went to juputer notebook. as expected it was 404 and then i hit get the latest lab file button and got myself the files. but i don’t know whether they’re the new ones or not.
because it says it was modified 3 months ago after i get the new files.