Check the .grad attribute of all parameters, which don’t seem to be updated and see if the gradients have valid values or are all zero or even None.
If they are set to None after the first backward and before the first zero_grad() call, your computation graph might be broken. On the other hand, if they are zero, some operations in the model might kill the gradient.
Make sure that you check the .grad attributes after the backward and before the zero_grad operation.