Week 4 - Programming Assignment 1 - Grader Gives 0 Points

Greetings,

In this assignment, all exercises (except exercise 1) pass all the tests, however the grader returns 0/100 points.

I have already tried the troubleshooting steps proposed in this post: Help! My code is correct, but the grader gives me 0 points! - Course 1 Version

I have also tried other troubleshooting techniques explained in other posts, such as cleaning cookies and cache, trying different browsers, double-checking that I am signed into the correct account, etc.

The link to the course item is here: Coursera | Online Courses & Credentials From Top Educators. Join for Free | Coursera

Is it possible to have course staff take a look directly in the notebook instead of going through all the troubleshooting again?

Thank you.

Please post a screen capture image that shows the detailed grader feedback.

Thanks for the quick reply @TMosh . I fixed a bug in Exercise 1 and now the grader returns a 100/100. So my problem is resolved.

However, it is still strange the the autograder would return a 0/100 when the remaining exercises were correct. So I will post the output of the autograder from the 0/100 submissions. See below:

[ValidateApp | INFO] Validating ‘/home/jovyan/work/submitted/courseraLearner/W4A1/Building_your_Deep_Neural_Network_Step_by_Step.ipynb’
[ValidateApp | INFO] Executing notebook with kernel: python3
Tests failed on 10 cell(s)! These tests could be hidden. Please check your submission.

The following cell failed:

print("Test Case 1:\n")
parameters = initialize_parameters(3,2,1)

print("W1 = " + str(parameters["W1"]))
print("b1 = " + str(parameters["b1"]))
print("W2 = " + str(parameters["W2"]))
print("b2 = " + str(parameters["b2"]))

initialize_parameters_test_1(initialize_parameters)

print("\033[90m\nTest Case 2:\n")
parameters = initialize_parameters(4,3,2)

print("W1 = " + str(parameters["W1"]))
print("b1 = " + str(parameters["b1"]))
print("W2 = " + str(parameters["W2"]))
print("b2 = " + str(parameters["b2"]))

initialize_parameters_test_2(initialize_parameters)

The error was:

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-4-ff14dbec5020> in <module>
      7 print("b2 = " + str(parameters["b2"]))
      8 
----> 9 initialize_parameters_test_1(initialize_parameters)
     10 
     11 print("\033[90m\nTest Case 2:\n")

~/work/submitted/courseraLearner/W4A1/public_tests.py in initialize_parameters_test...
     31     ]
     32 
---> 33     multiple_test(test_cases, target)
     34 
     35 

~/work/submitted/courseraLearner/W4A1/test_utils.py in multiple_test(test_cases, ta...
    140         print('\033[92m', success," Tests passed")
    141         print('\033[91m', len(test_cases) - success, " Tests failed")
--> 142         raise AssertionError("Not all tests were passed for {}. Check your ...
    143 

AssertionError: Not all tests were passed for initialize_parameters. Check your equ...

It depends on the nature of your error on that one failing function. If it causes the grader not to be able to compile the code, then it can’t get as far as running the rest of the tests for the other functions.

It would be helpful, as Tom suggested, to see the actual output of the grader under “Show Grader Output”.

When the grader hits an assert, it stops running and you get a score of 0.

It’s not able to run your notebook if it contains runtime errors.

Thank you so much for all the help @TMosh and @paulinpaloalto . The nature of the error in exercise one was that I was calling the wrong random generator function. I confused “randn” and “rand”.

@TMosh I’m getting the same issue here, my exercise 1 is passing just fine and I’m not sure why I’m still getting a 0 - any help is appreciated. thanks!

Please show us the grader output or the failing test output that you are seeing.

@TMosh here it is

I do not have access to modify that particular cell either

The problem is that you have not executed the cell that defines initialize_parameters. Well, either that or perhaps you have accidentally converted it from a Code cell to a Markdown cell.

Please try “Cell -> Run All Above” and then run the test again.

Are you sure that there are no syntax errors thrown when you run the cell that defines initialize_parameters?

Yes, the test cells are not editable. If the test fails, the solution is not to change the test. It is to figure out why the test fails.

yes, I tried what you suggested but still seeing the same issue - when I run the cell it says all tests pass but when I click on validate I still see the same error shown in my previous screen shot

{moderator edit - solution code removed}

Validate will not work until you have completed all the functions in the notebook. It also does not make sense to submit to the grader until you have finished all the functions.

BTW I never use the “validate” function. Just run the test cases in the notebook. Once they all work, then submit to the grader.

“Validate” does nothing useful that I know of. I have never used it, and I have heard of no other students who have used it.

hey guys, the issue is there even though ive completed all functions in the notebook.Im not using validate, I am submitting the assignment and still receive a 0. I’m not really sure where to go from here :frowning:

Please show us the message from the grader under “Show Grader Output”.

And are you sure that all the tests pass in the notebook? Please do this sequence:

Kernel -> Restart and Clear Output
Save
Cell -> Run All

Then carefully scan through and make sure that everything executed without errors or any assertions or other exceptions.

here is the error log from the grader:


and yes ive ensure all cells were properly executed many times except for one test case failed of 3 in the L_model_backward function. But I thought I need 70/100 to pass. and all other cells are passing test cases