I guess model2 will get the output of model1 as its input?
If so, this behavior is expected, since loss_G1.backward() will clear the intermediate activations in model1, which are necessary to calculate the gradients using loss_G2.backward().
Could you explain your use case a bit?
If you don’t need gradients in model1 w.r.t. loss_G2, you could simply detach model1's output before passing it to model2.