Error in Neural Style Transfer on my own Jupyter Notebook

I got an error, which is very strange. Maybe my code could be wrong. Basically here are the block of code it tried to run.


But then it gives me this error.

I think that the generated_image was the issue. So i went to look at my code and finds nothing wrong (maybe). So is there anyone could tell me the issue, and i can give the code too.

Hi @CourseraFan

While computing the function compute_style_cost you are calling the function compute_layer_style_cost this should take different activations of S and G.

Since you are using for loop, to loop over different activations of S and G i.e, a_S[i], a_G[i].

Thank you.

Oh, now i see. Thanks for your help! Appreciate it.