Doubt in random_mini_batches function in exercise 1 of week 2

On running the code it shows an error sayin “Wrong output for variable in position 0.”. It works fine for the rest of the positions.

Can someone tell me why this is happening and how can I fix this

Hi, @Aditya.

There’s something wrong with the shape of the third mini_batch_Y. Take a look at the last few lines of the function random_mini_batches and let me know if you need any hints.

Good luck!

Thank you, I understand what was the problem now

1 Like

can you provide more hint?

Hi, @Hamid_ILBEYGI.

Of course!

Let me know if you need more help :slight_smile:

1 Like

Thank you ,

my last line are

[Removed solution code]

however I am still getting the error :slight_smile:

Wrong shape in the last minibatch. (12288, 19) != (12288, 20)

Here’s another hint: it’s off by one :slight_smile: