Week 4 Assignment 2 Grader Failing on Graded Cell 5 when All Testcases Passed

On Graded cell 5, I get All Testcases Passed!, but the grader is giving this error:

“Code Cell UNQ_C5: Unexpected error (TypeError(‘in user code:\n\n /tmp/student_solution_cells/cell_26.py:56 train_step *\n grad = tape.gradient(J, generated_image)\n /usr/local/lib/python3.7/site-packages/tensorflow/python/eager/backprop.py:1034 gradient **\n if not backprop_util.IsTrainable(t):\n /usr/local/lib/python3.7/site-packages/tensorflow/python/eager/backprop_util.py:30 IsTrainable\n dtype = dtypes.as_dtype(dtype)\n /usr/local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:650 as_dtype\n (type_value,))\n\n TypeError: Cannot convert value None to a TensorFlow DType.\n’)) occurred during function check. We expected function train_step to return train_step test 1 failed. Please check that this function is defined properly.
If you see many functions being marked as incorrect, try to trace back your steps & identify if there is an incorrect function that is being used in other steps.
This dependency may be the cause of the errors.”

Hey @Staticvoid,
One of the functions used in your code is returning a None value in perhaps some of the cases, which are not caught by the test-cases, and hence the issue. It’s hard to find the exact issue with the traceback provided. Download your notebook from Coursera and please DM it to me. For that, click on my name, and select “Message”. Make sure to not post it publicly, since it is strictly against the community guidelines.

Regards,
Elemento

I just sent the DM to you! Thanks for helping.

1 Like

Hey @Staticvoid,
I just checked your notebook. I submitted your code of the 5 code cells, and it ran just fine, giving me a complete score of 100. Try fetching the latest version of the notebook and submitting your assignment again. I hope this helps. If not, let me know, I will ask the other mentors to look into it, since it works absolutely fine on my system.

Regards,
Elemento

I just resubmitted it, seems like the grader may have had some errors the first time since it gave me 100 this time. Thanks for the help!

Please excuse my previous (now deleted) reply, I posted it in the wrong thread.