It is difficult, because its not really possible to add extra debug statements.
This is an example of one of my lines. Not sure why it doesn’t work, AL, cache = linear_activation_forward(A_prev, parameters[f"W{l}“], parameters[f"b{l}”], activation=“relu”)
Here’s a thread which goes through the “dimensional analysis” for that “2hidden” test case, so that you can see what is supposed to be happening. Then you need to track backwards to figure out where your code went off the rails.
Note that the bug is not in the lower level routine: it is in your L_model_forward logic. You are passing mismatching parameters down to the lower level functions.