C3_W2_RecSysNN_Assignment Auto-grader Error 'd' not defined

I am recieving the following auto-grader error:
"
Code Cell UNQ_C1: The value of your variable ‘user_NN’ is correct.
Code Cell UNQ_C1: The value of your variable ‘item_NN’ is correct.
Code Cell UNQ_C2: Unexpected error (NameError(“name ‘d’ is not defined”)) occurred during function check. We expected function sq_dist to return type <class ‘bool’>. Please check that this function is defined properly.
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.
"

The only place in the code where ‘d’ is used is here is in the sq_dist function that is pre-defined by the lab notebook.

Additional information:

  1. The autosave function of the notebook does not work
  2. The notebook is showing an error from the time I first opened it

Remarks about the Auto-grader output:

  • Why is there an error indicating that it expects the sq_dist function to return a boolean data type? This should be a float type.
1 Like

First, please verify whether you have ever re-named the notebook file.

Have you duplicated, copied, or moved any of the code cells in the notebook?

1 Like

Updates:
I tested the code you posted for sq_dist(). It works fine and does not throw any errors. So that’s not the cause of the grader error.

Please don’t post your code on the forum… That’s not allowed by the Code of Conduct.

I won’t be able to look at the grader’s test cases until later this evening, so I don’t have anything to say about the boolean data type.

2 Likes

I have not, that I am aware of. How do I re-set it so I start from scratch?

1 Like

I have removed my code snippet.

1 Like

Check this out.

2 Likes

Note: I am unable to explain this error message.

All my code has passed the tests but I get this error when trying to submit my assignment: Cell #9. Can’t compile the student’s code. Error: TypeError(“unsupported operand type(s) for *: ‘float’ and ‘module’”)What could this error mean? I see it in the code, but it was code that was pre generated for the assignment.

Are you using the Coursera Labs environment, or are you using some other platform?

This is a puzzling issue, because in that assignment (notebook name “C3_W2_RecSysNN_Assignment.ipynb”), there is no user-provided code in the first nine cells. So the grader should not complain, unless you have modified something you ought to have left alone.