My code is correct, but the grader keeps giving me the same error! Course 4 version Week 2

Cell #UNQ_C2. Can’t compile the student’s code. Error: SyntaxError(“unmatched ‘)’”, (‘/tmp/student_solution_cells/cell_16.py’, 46, 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 46
)
^
SyntaxError: unmatched ‘)’

This error keeps showing up but there is no extra ‘)’. I have reviewed everything more than once, all tests passed. Any one with the same problem?

If anyone is in doubt regarding the extra ) im even sending a screenshot.

the problem is in:
weights=base_model_path
)

the grader doesnt like where the ‘)’ is, just place it next to path and it works. To anyone having problems in the future.

2 Likes

Thanks for your report. You are correct, the grader for this assignment is very picky about parenthesis location.

This is because the grader copies your code out of the notebook and puts it into a different template, and it’s not very good at handling whitespace.

1 Like