Hello. I have read many community posts with the same problem, the wrong value error. I have tried many variants with which they have solved it. But in my case neither seems to work. This is my latest variant, using **2.

J_style_layer = tf.reduce_sum(tf.square(tf.subtract(GS,GG)))*1./(4. * ((n_H * n_W)**2) * (n_C)**2)

What is the incorrect answer that you get? Maybe the problem is that your GS and GG values are incorrect. Did you use transpose in computing the inputs to the gram matrix routine? Not using transpose and just directly reshaping to the final shape you want ends up “scrambling” the data and you get a cost value of 2.9xxxxx instead of the 14.0xxxx that is the expected value.

Thank you very much, the mistake was not using the transpose