This error is raised during a forward pass, so the model.cuda() call will not cause the OOM as previously mentioned?
If so, please post a minimal, executable code snippet using random input tensors, so that we could debug it.