Hi all,
I’m getting the below error in Exercise 9: Predict.
All my code has passed the exercise-specific tests but now it seems that W1 has changed data type to a list or array as it can’t be indexed using a string:
Can anyone help with this?
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-22-eb08347ef392> in <module>
1 parameters, t_X = predict_test_case()
2
----> 3 predictions = predict(parameters, t_X)
4 print("Predictions: " + str(predictions))
5
<ipython-input-21-673ef527b78d> in predict(parameters, X)
18 # predictions = ...
19 # YOUR CODE STARTS HERE
---> 20 A2, cache = forward_propagation(parameters, X)
21 predictions = np.round(A2)
22 # YOUR CODE ENDS HERE
<ipython-input-11-02ac29b26417> in forward_propagation(X, parameters)
18 # b2 = ...
19 # YOUR CODE STARTS HERE
---> 20 W1 = parameters["W1"]
21 b1 = parameters["b1"]
22 W2 = parameters["W2"]
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices