W3_A2_Ex-5.2_Test the Model on the Planar Dataset

I built my model and have passed all the tests, but when I try to plot the decision boundary, I get a “cannot reshape array” error.

Could something be wrong with my parameters? I printed them, in case that helps.

I don’t think you have parameters’ shape problems. I just added the print statement at the end of nn_model to check out the shape and values of parameter. Shapes are same as yours, though values are change.

Have you passed all the above tests? If so, try Kernel → Restart and then run all the cells and see. If issue persist, then send me your Notebook in a private message. But first confirm that have you passed all the above tests?


Hello @avi_newman! Thank you for sending me your code.

OK. In your predict(parameters, X) function, when calling forward_propagation function, one of input arguments is t_X. What is t_X? Your predict function knows about X, not t_X.


1 Like


predict() is used above with t_X. Thank you so much for helping me find this copy/paste bug. Hopefully no one else will make the same mistake.

Good :+1: :+1: :+1: :+1: