C3_W1_Assignment: There was a problem grading your submission

I have completed the programming assignment of NLP course 3 week 1. Every cell in the notebook tells me “all tests passed”. However, when i submit the code, i get 60/80 with the following message for the first two graded functions:

I’m not able to find any issue in my code, since all the test evaluate correctly.
I have already tried to restart the kernel and submit again, but it didn’t solve the problem. Stderr seems fine given that i get “all tests passed”.

The most common source of this error seems to be use of ‘global’ variables inside a graded function. The code runs fine in the Jupyter notebook because of the namespace and scope, but fails when executed as a standalone function in the autograder environment. See for example this similar thread:

However, this one is also very interesting and doesn’t seem to be programmer self-inflicted:

Let us know what you find out?

Thank you so much, I was able to solve the problem. Using autocomplete I wrongly typed the global variable “Vocab” instead of using “vocab_dict” given by the function.

Many thanks!

1 Like

Glad that helped. I have personally invested, ok, completely wasted, several hours staring at code with a global variable inadvertently introduced through cut and paste. Whenever you pass the local unit tests but not the grader it’s a good thing to look for.

So Good, can you teach me haha