Submitting problem in week 2 assignment 2

  • Week # 2
    Assignment 2 “Transfer learning with mobilenet” there is an error when submitting the solution, the code works very well, but when submitting it raises a FileNotfFoundError in Cell #3, which is I should not even touch it.

Typically this sort of problem happens if you have done any of the folloing things to the notebook:

  • Added a cell.
  • Copied and replaced a cell.
  • Moved a cell.
  • Deleted a cell.
  • Copied a cell from another notebook.
  • Renamed your notebook ipynb file.

The easiest way to fix this is by deleting your current notebook, and using the “Get latest version” tool to get a new copy.

Note that you have to delete (or rename) your notebook - otherwise “Get latest version” does not work.

1 Like

I think the problem is in the autograder because the file that is not found is exist in the local but not within the grader, because usually they are using helper function to load the data but here the assignment came with a file that is not found in the autograder

The autograder is working correctly.

It doesn’t just run your notebook - it extracts certain portions and runs only those.

If you have added code or modified some cell metadata, so that the grader is importing a cell that the grader does not support (or your cell uses an asset that is only in the notebook environment), then the grader will rightly throw an error.

1 Like

Yes, as Tom says, the grader works fine for me also. So there must be something wrong in how you wrote the code that happens to work locally, but not in the grader environment.

It might give us a better clue if we could see the complete message that you get from the grader. Does it actually show you the name of the missing file? Please click “Show grader output” and then upload a screenshot of what it says.


I have the same problem with grade for W2A2

Are you sure that your code runs correctly in the notebook locally? Please do the following sequence:

Kernel -> Restart and Clear Output
Save
Cell -> Run All

Then carefully scan through the output of all the cells to make sure there are no syntax errors.

If there are no errors, then submit by doing this sequence:

Kernel -> Restart and Clear Output
Save
Submit

The point is to make sure you submit just the “cleared” notebook with no generated output. The grader does not need to see your output: it only needs to call your functions.

Please let us know the results. If it still fails after that, then we will need to look at your notebook. We cannot do that directly or on a public thread, but I will send you a DM about how to proceed in that case.

Hi! I am facing the same issue. I have followed all steps. Please help

Please show us the error output you are getting from the grader. If you have the exact same message about mismatching parentheses, then it means you have a syntax error in your notebook.

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

Dear Paulin

Thank you for your response.

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

Are you sure that things run correctly when you run the local tests in the notebook? If so, then I think we need to see your notebook. We can’t do that in a public thread, but please check your DMs for a message from me.