Week4-assignment2-exercise1

hello.
can you explain to me this problem?
how can I fix it?

dA1, dW2, db2 =linear_activation_backward(dA2, cache2,“sigmoid”)
dA0, dW1, db1 = linear_activation_backward(dA1, cache1,“relu”)

result:
ValueError 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)
65 # dA0, dW1, db1 = …
66 # YOUR CODE STARTS HERE
—> 67 dA1, dW2, db2 =linear_activation_backward(dA2, cache2,“sigmoid”)
68 dA0, dW1, db1 = linear_activation_backward(dA1, cache1,“relu”)
69 # YOUR CODE ENDS HERE

~/work/release/W4A2/dnn_app_utils_v3.py in linear_activation_backward(dA, cache, activation)
309 db – Gradient of the cost with respect to b (current layer l), same shape as b
310 “”"
→ 311 linear_cache, activation_cache = cache
312
313 if activation == “relu”:

ValueError: too many values to unpack (expected 2)

It looks like the cache2 value that you pass to linear_activation_backward must be wrong. It should be one of the layer cache entries, which is a 2-tuple, but it seems to only contain one element. So how did that happen? Where was cache2 initialized?

Are you sure that you did not manually copy over your functions from the previous Step by Step exercise? If so, that is a mistake. They were imported for you by the template code.