C3_W3_A1_Assignment - Lunar Lander Question

Hi Everyone,

It appears my code is correct for both # UNQ_C1 and # UNQ_C2 as all tests as passing. However, when I submit the assignment I am only scoring 50% and am receiving the following message. I have no idea what the issue is. I went through the other previously posted topics on this item and could not figure out my issue. What am I doing wrong?

My error:

Code Cell UNQ_C2 failed: compute_loss test 1 failed
If you see many functions being marked as incorrect, try to trace back your steps & identify if there is an incorrect function that is being used in other steps.This dependency may be the cause of the errors.

It means your code for compute_loss did not work correctly with the tests that the grader uses.

Thank you, @TMosh. Although my tests are passing, code blocks 5 and 18 show errors in red: Out [5] and Out [18]. Is there a way to re-start the kernel fresh (as if I am starting the assignment all over)? I am not sure that would solve the problem, but I just cannot get past whatever the issue may be.

If you exit the notebook and then re-load it, that will restart the kernel.

Also, within the notebook you can restart the kernel from the “Cell” menu.

I’m still scratching my head. Is this the original code for In [5]? When running it, it comes back in red. Isn’t this the original code? Did I mess something up? Why is this code block highlighted in red?

env.reset()
PIL.Image.fromarray(env.render(mode=‘rgb_array’))

Please post a screen capture image that shows this red code.

I’m not sure that “Out[5]” in red is an error message.

I tried again. In addition to In [5] showing red, In [18] also shows red (see below).

The grader gave me a 50%. The error messages are provided below. However, In [10], In [12], and In [13] each show “All tests passed!” I am really lost right now. I appreciate the assistance.

Code Cell UNQ_C1: The value of your variable ‘q_network’ is correct.
Code Cell UNQ_C1: The value of your variable ‘target_q_network’ is correct.
Code Cell UNQ_C1: The value of your variable ‘optimizer’ is correct.
Code Cell UNQ_C2 failed: compute_loss test 1 failed
If you see many functions being marked as incorrect, try to trace back your steps & identify if there is an incorrect function that is being used in other steps. This dependency may be the cause of the errors.

There is an error in your compute_loss() function.
The grader tests your code with different tests than the notebook uses.

Check your personal messages for instructions.