C5W1A3 exercise2 error confused


Does anyone know what does this mean? I am confused :pleading_face:

Any luck here? I have the same error.

Initially, restart the kernel.

Then check if you have done the initial part correct, i.e.

Step 2.A: select the "t"th time step vector from X.

x = X[:,t,:]

Maybe this may solve your error.

@SwadhinNagulpelli That’s the answer for Exercise 1; @ladan_yang is asking about Exercise 2.

“Restart & Clear Output” under Kernel menu helps. Save work first just in case.

I was getting the same error message, while having solved the issue in exercise 1.

I solved it in exercise 2 by specifying the axis in the argmax function, setting it to 1. Then, all the expected shapes are consistent across the different steps. I also needed to restart the kernel and run all the cells to see the results of my solution.

x = tf.math.argmax(out, axis=1)

Hi, Sofisappia.

Welcome to the community.

Besides, it’s also worth to note that keeping the last axis in mind will also prove a significant step.