NN&DL Week 4: code result is OK. But many type mismatch errors

Hi! I am stuck with L_model_forward(X, parameters) (In 18). Running the test code (In 19), I do get the correct output “AL = [[0.03921668 0.70498921 0.19734387 0.04728177]]”. Yet, after the output printed, I get lots of errors like these ones: “Error: The function should return a numpy array. in variable 0. Got type: <class ‘list’> but expected type <class ‘numpy.ndarray’>”… “Error: Wrong shape for variable 0.”
Apparently, that happens when running the line “L_model_forward_test(L_model_forward)”. Could that function by chance have some bags? Thank you.

1 Like

Have fixed the problem - I was appending the ‘caches’ list incorrectly.

2 Likes

Really glad you figured it out on your own! Keep it up Happy Learning!

I am having this exact same issue and have not been able to figure it out on my own. Do you have pointers on how to append “correctly”?

hm… that was long ago and my notebook code is already emptied. Try using
caches.append()

@elmaka8700 if @Dalkhat suggestion doesn’t solve your issues I would suggest that you post the specific error log you are getting.