How to Solve Submission Error When All Code Tests Pass Locally?

: I am enrolled in the Deep Learning Specialization by Andrew Ng. Specifically, in the Week 2 of the Convolutional Neural Network course. Although I have passed all the tests in the lab notebook locally, I encounter an error when I submit my notebook. In the grader output, I receive the following error message:
Cell #UNQ_C2. Can’t compile the student’s code. Error: SyntaxError(“unmatched ‘)’”, (‘/tmp/student_solution_cells/cell_16.py’, 39, 5, ’ )'))
Traceback (most recent call last):
File “/home/www/app/grading/exceptions.py”, line 112, in handle_solution_errors
yield {}
File “/home/www/app/grading/abstract.py”, line 393, in _grade
context = compiled_code.run(cell_index=cell.index)
File “/home/www/app/grading/submission/compiled_code.py”, line 195, in run
return list(self._code_items.values())[cell_num - 1].run()
File “/home/www/app/grading/submission/compiled_code.py”, line 54, in run
return import_module(self.import_statement, items)
File “/usr/local/lib/python3.8/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 839, in exec_module
File “”, line 976, in get_code
File “”, line 906, in source_to_code
File “”, line 219, in _call_with_frames_removed
File “/tmp/student_solution_cells/cell_16.py”, line 39
)
^
SyntaxError: unmatched ‘)’

Steps I’ve Tried:

  1. Resetting the kernel and re-running all the cells.
  2. Downloading a fresh copy of the notebook and pasting my code again.
  3. Reloading the notebook in a clean environment.
  4. Manually reviewing the code for unmatched parentheses or syntax errors.

What I Need Help With: Does anyone know what might be causing this issue? The error only occurs in the submission grader and not in my local tests. How can I debug or solve this?

Let me know if this works for you or if you’d like me to further customize this!

Hi @MG03000,

I’m going to DM you regarding this.

Thank you!! @Mubsi

Mario was using an older version of the solution.

1 Like