C1 W3 practice lab exercise 2: UnboundLocalError

Hi! I am having this error and could not solve it. Why is this happening?

Hello @Ayse_Nehir_Cevik

It seems like you are using loss_sum += …

But to be able to do this, you need to first initialize loss_sum = something

1 Like

oh, yes. I fixed the error thanks a lot!

You are most welcome @Ayse_Nehir_Cevik