I use pytorch1.9.0 and torchvision 0.10.0. But I realized where did I go wrong. after the amp_backward function, I call the optim.step() again. But in fact scaler.step(optim) have called the optim.step() implicitly. I’ll fix it and try again.