C4W3 - A1 YOLO Grading Error

Hi fellow learners,
I am unable to get past the Grading Failed error for the YOLO assignment notebook.
I see this has been an error in the past. However, I am unable to resolve it. My notebook has passed all the tests and I have followed the submission guidelines. I am still receiving grading failed error. This is my 5th attempt after waiting for some time between submissions.

Any suggestions. Thanks in advance

Hello Chakresh,

Can you share the screenshot of your grader output which gives feedback about why you are failing your assignment.


Here it is … Thanks in advance. :slight_smile:

As you are stating you have passed all the test.

What you could do is try these steps.

I suppose you must have a saved a copy of your assignment.

if yes, then get a fresh copy of the assignment by clicking on help, get the latest version and update lab.

check if you have got a fresh copy.

if you still haven’t, then click file, then open which will open the section where your assignment and other files will be there. Select the assignment and delete the assignment notebook.

Then you will get 404 error on the browser.

At this time, click help, then reboot. once you have completed the rebooting. Click help again, then Get the latest version and then update lab.

This step will surely get you a fresh copy.

No re-do your assignment by referring to your saved copy of the assignment and submit.

Let me know if your issue was resolved.


Hello everyone,

I am having the same problem. Although my notebook passes all the tests, I am getting a grading failed error. I tried what Deepti_Prasad suggested, but it did not work.

Does anyone know how to solve this problem?

Thanks for your help in advance.

Can you send the notebook via personal DM.

Did you try re-doing the assignment on fresh copy/updated assignment notebook?

The only reason one fails the grader still would require to look at your codes as it might need some correction.

Yes, I followed the instructions you wrote before. I also re-do the assignment from the beginning.

I have been waiting so far about 30 min to get a grade in my last attempt, the grader keeps ongoing…


Incorrect codes for

# GRADED FUNCTION: yolo_filter_boxes

    # Step 1: Compute box scores
    ##(≈ 1 line) Compute box scores by doing the elementwise product as described in Figure 4 ( 𝑝×𝑐). you have not recalled the code with right numpy function for this code

# Step 3: Create a filtering mask based on "box_class_scores" by using "threshold". The mask should have the
    # same dimension as box_class_scores, and be True for the boxes you want to keep (with probability >= threshold)
    ## (≈ 1 line)

apply tensorflow function (with probability >= threshold) for this code

incorrect codes for


inter_width = incorrect code.  read instructions before the grader cell to do correction
inter_height = incorrect code.  read instructions before the grader cell to do the correction
inter_area = apply this instruction here * `inter_area` = You can use `max(height, 0)` and `max(width, 0)`

there is a tuple error for union area.

Incorrect code for

# GRADED FUNCTION: yolo_non_max_suppression

for mms_indices you have max_boxes_tensor but you are suppose to use max_boxes as it has already been defined for this grader cell.

Do these corrections.

Let me know once you have passed the grader.


Grader submission can fail if there is issue with code implementation even if you have passed all the test but if you have not used the right codes while implementing these codes, you will fail your grader.

Whenever you fail your grader, kindly go back to your assignment, review your codes again, look for instructions and hints where you could make change.

Most of the time the grader fails due to incorrect codes.

Rarely it will be coursera lab issue and if it happens refreshing the lab should solve the issue. if it doesn’t, then you need to look into your codes again.



if you also could not passed the grader, then send the notebook, or you can look yourself in your notebook again for corrections in the codes. Read the instruction before the each grader cell.

otherwise, send the notebook via personal DM. Click on my name and then message.


1 Like

Hi Deepti_Prasad,

thanks for the feedback.

I did the corrections, but I am still getting the same error.

I find some important problems with this assignment:

  1. The grade I receive is 0%. Does it mean that all my code is wrong even if the tests are passing?
  2. The code does not crash and shows where the possible issues might be.
  3. Based on your comments, does it mean that my implementation must match exactly what is expected? By instance, using np.multiply instead of *.

After trying all the suggestions, I still cannot get my code graded.
In my opinion, the assignment is not well designed. Although all tests pass, if eventually there are additional problems with the code, an error is not prompted. There are not hints to find where the errors could be.

Getting a fresh copy didn’t resolve the issue?

Hi saifkhanengr,

that was the first solution I tried, but sadly it did not work.

Hello @Deepti_Prasad! I think you reviewed @mart_gs notebook. If there is no error in the notebook, please tag Mubsi.

please send me your updated corrected notebook

Saif his notebook had code error, which I had suggested him to do correction. I don’t know if he has done correction correctly. need to review his updated notebook.

You can tag Mubsi as well, if you don’t find any issue in his codes.

If his codes are incorrect for build the model, I need to address that issue first. Until then even Mubsi cannot address as this is not coursera lab issue but code issue.

I will tag Mubsi If his updated notebook is fine i.r.t. coding.


Hi all,

I have a question regarding this. If the code is incorrect for grading, why there is not a prompt error? Without this, then the only way to know that there is an error is having the code checked by a third person. This creates a dependency, one needs to go to the forum and ask instead of trying to solve the issues by ourselves.


Incorrect code

Step 3: Create a filtering mask based on “box_class_scores” by using “threshold”. The mask should have the

# same dimension as box_class_scores, and be True for the boxes you want to keep (with probability >= threshold)
## (≈ 1 line)
filtering_mask = tf.greater_equal(box_class_scores, threshold) THIS IS THE CORRECT CODE, you didn't do the correction.

you clearly have not followed my any of the steps mentioned step by step. all the corrections made are incorrect or either ignored or left the same way, so you cannot pass the grader.

inter_width = np.maximum(yi2 - yi1, 0) INCORRECT CODE, YOU ARE NOT SUPPOSE TO USE NP.MAXIMUM OR 0 FOR THIS.

inter_height = np.maximum(xi2 - xi1, 0) INCORRECT CODE, YOU ARE NOT SUPPOSE TO USE NP.MAXIMUM OR 0 FOR THIS.


  • inter_area = You can use max(height, 0) and max(width, 0)

you didn’t make this correction to the above mistake, even after explaining clearly.

Please read the comments carefully again and see if you have done all the corrections.

although your grader can pass all the test but if not implemented according to the grader, will always cause grader failure. you can open file section and then check you metadata, to see where you are going wrong.