Persistent name error in Autograder

Hi. I keep getting this error message from the autograder for the final assignment of the course:

Error: Cell #UNQ_C1. Can’t compile the student’s code. Error: NameError(“name ‘Alpha’ is not defined”)
Traceback (most recent call last):
File “/home/www/app/grading/”, line 112, in handle_solution_errors
yield {}
File “/home/www/app/grading/”, line 393, in _grade
context =
File “/home/www/app/grading/submission/”, line 195, in run
return list(self._code_items.values())[cell_num - 1].run()
File “/home/www/app/grading/submission/”, line 54, in run
return import_module(self.import_statement, items)
File “/usr/local/lib/python3.7/importlib/”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1006, in _gcd_import
File “”, line 983, in _find_and_load
File “”, line 967, in _find_and_load_unlocked
File “”, line 677, in _load_unlocked
File “”, line 728, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/tmp/student_solution_cells/”, line 35, in
optimizer = Adam(learning_rate = Alpha)
NameError: name ‘Alpha’ is not defined

My code in the block runs well and passes the in-notebook test.
This error keeps occurring no matter how many times i reboot and re-run the notebook. Any ideas?

Yes try to replace Alpha with a real number value and lets see what happens!

1 Like

Does your code pass all of the tests in the notebook?
Did you modify your notebook to include an Alpha variable?

Note that the grader doesn’t use any global variables you may have added - it only looks at the functions that are marked for grading.


  • Do not rely on global variables.
  • Do not make unexpected changes to the notebook.

Yes that worked thanks.

1 Like