Week 4 error in last graded part

For the last step of training, I get this error for the cost calculations. however , my style cost and content calculations seem correct and all tests above pass. Could a mentor please help? Thank you


tf.Tensor(2555.306, shape=(), dtype=float32)

AssertionError Traceback (most recent call last)
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}"
9 J2 = train_step(generated_image)

AssertionError: Unexpected cost for epoch 0: 2555.305908203125 != 10221.168

I think I already answered this on another thread, but notice that there are factors of 1/4 involved in the formula here. Your answer is looking pretty close to 1/4 of the expected answer. It’s worth taking a look at the “order of operations” in your implementation of the cost formula.