Week 4 Assig 1 Exercise 8 built in function error

I’m facing error with the built in function sigmoid_backward function and the error appears is
~/work/release/W4A1/dnn_utils.py in sigmoid_backward(dA, cache)
74 Z = cache
—> 76 s = 1/(1+np.exp(-Z))
77 dZ = dA * s * (1-s)

TypeError: bad operand type for unary -: ‘str’

Hi @Asad_Ullah_Wallana ,

This function has been working for a long time without any issue. I suggest you check how the parameter ‘cache’ is constructed before passing to the sigmoid_backward() function.

the cache has ben constructed already
and if possible i can paste the code here

i’m using sigmoid_backward(dZ, activation_cache)
linear_cache, activation_cache = cache Also cache is the input argument for the model

Thank you i found my mistake based on your comments.

Hi @Asad_Ullah_Wallana ,

That is great you have got this sorted