Week 4 Assignment 2 Exercise 6 error

I’m getting an error that seems similar to the tf.square vs **2 errors seen … but I’m not getting a “really large negative value”.
My error is below:

tf.Tensor(400.3537, shape=(), dtype=float32)
AssertionError                            Traceback (most recent call last)
<ipython-input-128-c4cbeb243f35> in <module>
      6 print(J1)
      7 assert type(J1) == EagerTensor, f"Wrong type {type(J1)} != {EagerTensor}"
----> 8 assert np.isclose(J1, 25629.055, rtol=0.05), f"Unexpected cost for epoch 0: {J1} != {25629.055}"
     10 J2 = train_step(generated_image)

AssertionError: Unexpected cost for epoch 0: 400.35369873046875 != 25629.055

Can I get some help/ direction?

I should also note that all other exercises have “passed” their internal tests.

If all your other functions pass, then most likely there is some mistake in the train_step block, but I’m blanking on what errors I’ve seen from students in the past on this section. The best I can suggest is just to carefully double check your new logic in that block. Also have a look at your DMs for some other alternatives.

1 Like

Was making the function call incorrectly … thank you, Paul!