Exercise 5 - L_model_forward error

I am rather uncertain how to go about debugging the first error. It says it expected a list type, and it got a list type:

Fixed it, a silly mistake. As expected.

It’s great that you found the problem under your own power. I think you’ve pointed out a bug in the error message. Note that the first part of the message says it should be a numpy array. I’ll file a bug about that error in the test message.

BTW I am looking at the test code for that notebook and I literally do not see a way for you to get that exact error message. The one about “Got type <class list>, but expected type <class list>”. I suspect you are running with an old version of the files, not the latest.

If you’ve already passed the grader for this exercise, then it’s probably not a big deal. But you might want to follow the “Get Latest Version” procedure on the FAQ Thread and make sure to read the instructions all the way to the last couple of paragraphs where it tells you how to get the latest version of all the accompanying python files.

I’ve passed the assignment now, but what I did was I recalculated Z and plugged that into sigmoid() to calculate the Linear->sigmoid part, instead of using linear_activation_forward(). I also didn’t append the resulting cache to the list, only appending the two relu caches in the for loop. That’s what caused the error. As soon as I used the correct function, it worked fine.