W2 - E1 -random_mini_batches

I wrote this code for the equations but I don’t know what’s wrong that I’m getting this error.
AssertionError: Wrong shape in the last minibatch. (1, 20) != (12288, 20)

please help me.


Try to look for correction in your last mini batch codes lines.

Kindly remove the codes from the post. You can always share screenshot of the error you have encountered but not any codes of the grader cells.


Please check your code more carefully. You have an obvious “copy/paste” error in the section that handles the last partial minibatch. Notice that you never set the Y minibatch and set the X one twice.

1 Like