Course 1 ,Week 4 , Assignment 2 ,L-layer Neural Network

I am getting this error;
IndexError Traceback (most recent call last)
in
1 parameters, costs = L_layer_model(train_x, train_y, layers_dims, num_iterations = 1, print_cost = False)
2
----> 3 print("Cost after first iteration: " + str(costs[0]))
4
5 L_layer_model_test(L_layer_model)

IndexError: list index out of range

There is sth wrong with the cost list.



Hi @jp_superstar
It seems you are facing an error with cost variable. Note that the exercise is trying to print the first value in the list, or costs[0], and you are getting an index out of range. I am guessing if, somehow, your list is empty. You can try to print the cost list to check. Anyway, please review the computation before this statement to see why you are getting an invalid list.