Exercise 6 - train_step

Hi
I ran my code and faced this error. I computed a_G as an output of VGG model, then I computed J_content and J_style using compute_content_cost and compute_style_cost functions. Finally, I used total_cost function to calculate J.What is my mistake?
tf.Tensor(3.949584e-14, shape=(), dtype=float32)

AssertionError Traceback (most recent call last)
in
5 print(J1)
6 assert type(J1) == EagerTensor, f"Wrong type {type(J1)} != {EagerTensor}"
----> 7 assert np.isclose(J1, 10221.168), f"Unexpected cost for epoch 0: {J1} != {10221.168}"
8
9 J2 = train_step(generated_image)

AssertionError: Unexpected cost for epoch 0: 3.9495838511597464e-14 != 10221.168

Hi efanrzee,

It may help to rerun all cells, or at least the cell containing UNQ_C5. If this does not resolve things, feel free to send me your code so I can have a look what’s going on.

2 Likes

Yeah, thank you. It was solved.

Could you please help me with this issue?

Hi Muhammadahmad,

If this solution does not work for you, could you open a new post with a bit more detail as to the nature of the issue you’re facing? That way, other mentors can respond and this topic, which is considered to be solved, can be closed. Thanks!