Course 4 week 4 assignment 2 # UNQ_C5

The grader gives me 80%, meanwhile when I run all the cells gives me no errors.

This shows in the grader output:

Code Cell UNQ_C5: Unexpected error (NameError(‘in user code:\n\n File “/tmp/student_solution_cells/cell_26.py”, line 50, in train_step *\n J_content = compute_content_cost(a, a_G)\n\n NameError: name 'a' is not defined\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.

You did not mention which week and assignment you’re working on.

apologies the question is concerning weak 4 assignment 2 neural style transfer.

The call to compute_content_cost() should use the variables a_C and a_G.
Yours appears to use a and a_G.

I do not think this is the problem since I have used a_C and a_G not a and a_G

The error message clearly says your code uses used a, not a_C.

Did you perhaps rename your ipynb notebook file name? You can’t grade a renamed notebook, because the grader always uses the file with the original name.

I know what the error message says but my code is written with a_C also i did not rename my ipynb
image

I have no other explanation to offer.

1 Like

I appreciate your effort , Thanks

Hey @Muhammad_Mahmoud1!

Maybe you added an extra cell or duplicated that cell and used a instead of a_C there. Or maybe, previously you wrote a and then changed it to a_C but forget to run the cell? Try this: press Ctrl + f and find J_content = compute_content_cost, maybe you get something.

Best,
Saif.

1 Like

Thanks for your help the problem was solved

I am glad you resolved it. So, what was the problem?

I just cleared all the outputs and ran the notebook again then the submitted