C4W2 Assignment - SyntaxError: unexpected EOF while parsing

Hello everyone, I’m trying to solve C4W2 Assignment but got a “SyntaxError: unexpected EOF while parsing”. Does anyone know what happened? My notebook ran just fine from start to finish. Maybe a problem with the grader?

Thank you in advance

Cell #UNQ_C1. Can't compile the student's code. Error: SyntaxError('unexpected EOF while parsing', ('<string>', 1, 6, '_args('))
 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 410, in _grade
    output=output,
  File "/home/www/app/grading/graders.py", line 365, in __call__
    variable_value, is_passed = self._validate(context)
  File "/home/www/app/grading/graders.py", line 348, in _validate
    variable_value = self.value_getter(variable)
  File "/home/www/app/courses/tf2_c4/ex2/graders/graders.py", line 181, in getter_cell_UNQ_C1_q0
    expected_value='mnist',)
  File "/home/www/app/courses/tf2_c4/ex2/graders/graders.py", line 25, in FunctionGeneralArgumentChecker
    nargs, kwargs = eval(f'_args{args[1]}', globals(), local)
  File "<string>", line 1
    _args(
         ^
SyntaxError: unexpected EOF while parsing

It seems you are missing a: “(”, “)” or a string is open → "string

Hello, I think I could be having the same issue…

I checked like 5 times that no parenthesis is missed, and that no string is open… moreover, I can run it without issues, and achieve a result at the end of the notebook (this is given code, not student one):

But, still, the auto-grader fails:

Cell #UNQ_C1. Can't compile the student's code. Error: SyntaxError('unexpected EOF while parsing', ('<string>', 1, 14, "_args('mnist',"))
 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 410, in _grade
    output=output,
  File "/home/www/app/grading/graders.py", line 365, in __call__
    variable_value, is_passed = self._validate(context)
  File "/home/www/app/grading/graders.py", line 348, in _validate
    variable_value = self.value_getter(variable)
  File "/home/www/app/courses/tf2_c4/ex2/graders/graders.py", line 181, in getter_cell_UNQ_C1_q0
    expected_value='mnist',)
  File "/home/www/app/courses/tf2_c4/ex2/graders/graders.py", line 25, in FunctionGeneralArgumentChecker
    nargs, kwargs = eval(f'_args{args[1]}', globals(), local)
  File "<string>", line 1
    _args('mnist',
                 ^
SyntaxError: unexpected EOF while parsing

What could this be about, please?

Thanks in advance

syntax error is related to your Unq c1 cell and not the cell you shared here.

The previous mentor mentions one to check if there are any missed (,) or "

Yes, I know it is not related to that cell, I just pretended to show that it worked…

Still, I was able to pass it… what I did?
All tfds.load parameters in the same line…

tfds.load("mnist", split=...

instead of

tfds.load("mnist", 
          split=...

Before that I had switched the quotes around mnist from single ’ to double " as well, but the submission had failed (although I might have forgotten to save a checkpoint…)

Thanks anyway

this way could have caused the syntax as correct placement on enter keys can get mixup.

Glad you could add your points.

Regards
DP

1 Like