Hello,
This kind of error means that the variable that you named linear_cache is not defined yet at the position that it is executed by the Python interpreter.
Maybe you declared it with another name? or another possibility is that you did not execute a cell where you defined it.
The problem is that you are passing an incorrect value for the “activation” parameter to linear_activation_forward and, as a result, it does not match either of the possible choices. You are passing an object reference to the function in question. The lower level function you are calling expects the string name of the function. In other words, relu is not the same thing as “relu”. The former is an object reference to the function. The latter is the string name of the function.
Thank you so much. It helped
Welcome to the community.
If you look at parameters that you passed to linear_activation_forward() for activation, those are not “String”. For example relu is a local variable, and is not a string unless you inserted a string "relu" in a variable relu. And, Paul described exactly samething. So, you already have the answer in here.
linear_activation_forward() only takes "relu" and "sigmoid" as a string value for activations. If parameter passed is not any of those, then, no further calculation is processed. Then, there may be some unassigned variable exist.
Right. As Nobu describes, this is exactly the same error that was explained earlier in this thread.


