W2_A1_Logistic Regression Practice Lab

Update: I fixed the problem. But I’m posting my solution in case other people experience the same issue. I couldn’t find this error when searching the forums. Solution is at the bottom.

I came across an error with the built in code. It’s right after building my model and training it. I’ve tried troubleshooting the error and am uncertain what list it’s complaining about.

The issue is num_px is an array of x, y dimensions for a picture. Inside the reshape() change it to the following: num_px[0], num_px[1]

You must have created that mistake. num_px is a scalar in my version of the notebook.

You’re right, looking back where num_px is defined it’s my fault. It works everywhere else. Interesting that it would work all the way through without issue.

Well, if you look through, you’ll find that num_px is not actually used anyplace else other than for a few print statements, until you get to that final segment. You must have set it to the whole “shape” tuple, instead of either the second or third element of the tuple. They did give you a set of “expected values” to compare with your values and some of the print statements would have produced pretty odd results with your implementation. So you must have just overlooked those anomalies …

Actually I misunderstood and created my own array using the x_train_orig.shape[1], twice. I did overlook it in my rush to get to “the exciting part”. I saw the 64 and was like “yep, moving on”