I don’t know what might be failing inside your model, but in case you are using an older PyTorch release, update to the latest one (or the nightly) and try to apply the same debugging strategy by isolating the iteration, which fails. Then check the inputs, intermediate activations, and gradients for any invalid values.