I run my code, and this message comes out.
I have no idea - what part is wrong in my code.
Could you give me a hand?
UnboundLocalError Traceback (most recent call last)
in
----> 1 parameters, costs = two_layer_model(train_x, train_y, layers_dims = (n_x, n_h, n_y), num_iterations = 2, print_cost=False)
2
3 print("Cost after first iteration: " + str(costs[0]))
4
5 two_layer_model_test(two_layer_model)
in two_layer_model(X, Y, layers_dims, learning_rate, num_iterations, print_cost)
46 # A2, cache2 = …
47 # YOUR CODE STARTS HERE
—> 48 A1, cache1 = linear_activation_forward(X, W1, b1, relu)
49 A2, cache2 = linear_activation_forward(A1, W2, b2, sigmoid)
50
~/work/release/W4A2/dnn_app_utils_v3.py in linear_activation_forward(A_prev, W, b, activation)
209 A, activation_cache = relu(Z)
210
→ 211 assert (A.shape == (W.shape[0], A_prev.shape[1]))
212 cache = (linear_cache, activation_cache)
213
UnboundLocalError: local variable ‘A’ referenced before assignment