Art_Generation_with_Neural_Style_Transfer-assignment_doubt

Code Cell UNQ_C1: Unexpected error (NameError(“name ‘m’ is not defined”)) occurred during function check. We expected function compute_content_cost to return compute_content_cost test 1 failed. Please check that this function is defined properly.
Code Cell UNQ_C2: Unexpected error (AttributeError(“‘NoneType’ object has no attribute ‘shape’”)) occurred during function check. We expected function gram_matrix to return gram_matrix test 1 failed. Please check that this function is defined properly.
Code Cell UNQ_C3: Unexpected error (TypeError(‘cannot unpack non-iterable NoneType object’)) occurred during function check. We expected function compute_layer_style_cost to return compute_layer_style_cost test 1 failed. Please check that this function is defined properly.
Code Cell UNQ_C4: Function ‘total_cost’ is incorrect. Check implementation.
Code Cell UNQ_C5: Unexpected error (TypeError(‘in user code:\n\n File “/tmp/student_solution_cells/cell_26.py”, line 56, in train_step *\n grad = tape.gradient(J, generated_image)\n\n TypeError: Argument target should be a list or nested structure of Tensors, Variables or CompositeTensors to be differentiated, but recieved None.\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.

I am getting the above error while all the testcases are running fine.

  1. Have you changed the notebook’s name? Is it Art_Generation_with_Neural_Style_Transfer.ipynb?

  2. Have you deleted any ungraded cells or codes?

  3. Have you deleted or changed any codes in graded cells, outside of the START CODE HERE and END CODE HERE comments?

name of the notebook is “Art_Generation_with_Neural_Style_Transfer.ipynb”
I updated the notebook and rewrite my codes.
Now i am getting the below error.

Code Cell UNQ_C1: Unexpected error (TypeError(“ufunc ‘isfinite’ not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ‘‘safe’’”)) occurred during function check. We expected function compute_content_cost to return compute_content_cost test 1 failed. Please check that this function is defined properly.
Code Cell UNQ_C2: Unexpected error (AttributeError(“‘NoneType’ object has no attribute ‘shape’”)) occurred during function check. We expected function gram_matrix to return gram_matrix test 1 failed. Please check that this function is defined properly.
Code Cell UNQ_C3: Unexpected error (TypeError(‘cannot unpack non-iterable NoneType object’)) occurred during function check. We expected function compute_layer_style_cost to return compute_layer_style_cost test 1 failed. Please check that this function is defined properly.
Code Cell UNQ_C4: Function ‘total_cost’ is incorrect. Check implementation.
Code Cell UNQ_C5: Unexpected error (TypeError(‘in user code:\n\n File “/tmp/student_solution_cells/cell_26.py”, line 56, in train_step *\n grad = tape.gradient(J, generated_image)\n\n TypeError: Argument target should be a list or nested structure of Tensors, Variables or CompositeTensors to be differentiated, but recieved None.\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.

Please send me your notebook in .ipynb format in a private message. Click my name and message. I will check it in one and a half hours.

Here’s a thread about the “ufunc ‘isfinite’” error. It probably means you are generating an array where you should be generating a scalar. That’s for UNQ_C1.

Then for UNQ_C2 it looks like your code is incomplete and there’s a None somewhere that should have been replaced with real code.

And so forth. I’m sure Saif will be able to give more specific guidance, but there is a fertile field in the error messages. Also I would bet money that your notebook actually doesn’t pass the local tests. There’s just too much wrong there …

Most likely you have renamed your version of the notebook and the grader is grading a different (probably clean) notebook.