I have a setup in which there are two models (f, g) (I’m training f(g)). If I keep find_unused_parameters=True for both models, there is error like yours. When I use find_unused_parameters=True for only the first model, error disappears.