neonbjb:

Maybe some tips on alternative approaches?


I would try to either:

reduce the batch size and try to train both models on the device
if you have two GPUs, use each GPU for a single model
try to use torch.utils.checkpoint to trade compute for memory