Course 3, Week 3 — Lunar Lander DQN - compute_loss passes all local tests but autograder fails "test 1" every time

Hi everyone,

I’m stuck on a grading issue with the Deep Q-Learning (Lunar Lander) assignment in Course 3, Week 3, and I’d appreciate any guidance from mentors or staff.

Lab ID: phrtxiodwhir

The problem:
My compute_loss function (Exercise 2 / UNQ_C2) fails on the autograder with:
“Code Cell UNQ_C2 failed: compute_loss test 1 failed”

Grade received: 50% (need 80% to pass).

However, when I run test_compute_loss(compute_loss) locally in the notebook — using the actual public_tests.py file provided in the lab - it returns “All tests passed!” every time, including all four internal assertions.

My compute_loss implementation:

[removed by mentor]

This matches the standard DQN target formula exactly, and UNQ_C1 (q_network, target_q_network, optimizer) is confirmed correct by the grader every time.

What I’ve already tried, with no change in result:

  • Restarting the kernel and re-running all cells from scratch.
  • A full “Restart & Clear Output → Run All,” letting the complete ~12-minute training loop finish (which does complete successfully — “Environment solved in 534 episodes!”).
  • Confirming the compute_loss cell is a proper Code cell, not accidentally converted to Markdown.
  • Closing duplicate browser tabs of the same lab.
  • Rebooting the lab server via the Lab Help panel.
  • Submitting 6+ times across different timestamps on the same day - identical failure message every time.

Given the consistency of the failure despite passing the actual grading logic locally, I suspect this might be a backend sync issue between the lab environment and the autograder for this specific lab.

Has anyone else hit this exact issue recently? Any guidance on getting this manually regraded would be appreciated — this is the final graded item in the course.

Thanks in advance!

Hello @Kaushik_Manivezh,

I have just submitted the assignment on my side and I got full marks, so I think the grader was fine. Also, getting the “All tests passed” message only means you have passed the public tests, but it does not guarantee you will also pass the grader.

However, the grader is not as flexible as human but it has certain requirements (will be mentioned in the steps below) to the notebook, and here is my recommendations:

  1. Backup your solutions in a text editor

  2. Get a fresh copy of the assignment notebook on Coursera by following these steps, during which you will have to rename or delete your current notebook that has the name C3_W3_A1_Assignment.ipynb

  3. Move your solutions to the new notebook in the Coursera environment (the notebook should stay on Coursera all the time). Never make any changes outside the areas marked between ### START CODE HERE ### and ### END CODE HERE ###. Also, in your solutions, only write required code which means that for any other code, for example, print statements added by you, remove or comment them out.

  4. Click “File” > “Save and Checkpoint” and make sure that “Last Checkpoint: a few seconds ago” is shown right next to the filename. This makes sure Coursera has received your latest works.
    image

  5. Submit your assignment.

Btw, it is a forum rule that we can’t share our works here, but please don’t worry because I will remove it for you. If you have doubts about your work, this exercise actually provides very straightforward hints in the notebook under the exercise’s test cell. You can check it out by hitting “Click for hints”.

Cheers,
Raymond