Code works but the model doesn't train

I trained a model

the code works but the model loss doesn’t get better.

the training loss looks like this.


What is usually the reason when this type of problem occurs??

With loss this big you need extremely small learning rate, otherwise your weights will change at crazy amounts. Seems like you are adding loss across samples/batches instead of averaging it.