I cannot find any obvious issues by skimming through the models.
Try to add print statements into the forward methods of all models and check, if the activations have a valid .grad_fn via print(x.grad_fn).
At one point in a model the statement should return None and the previous operation would detach the tensor from the graph. Also make sure you haven’t globally disabled the gradient calculation e.g. via torch.set_grad_enabled(False).