The repeated pattern indicates that you are not shuffling the data, which also shows your code, so could you enable shuffling and see if it would help in any way?
Also, since the loss seems to be exactly the same, your computation graph might be detached, so check if all parameters get valid gradients after the loss.backward() operation via:
for name, param in model.named_parameters():
    print(name, param.grad)