assert mini_batches[n_batches - 1][0].shape == (nx, m % mini_batch_size), f"Wrong shape in the last minibatch. {mini_batches[n_batches - 1][0].shape} != {(nx, m % mini_batch_size)}"
This line has a bug, in 2nd week of programming assignment. My shape for last mini batch comes out to be (12288, 20) and the program also requires same shape but that line causes assertion error. It kept me stranded for very long time. Please fix it asap.