The original error is still the out of memory RuntimeError. The stack trace should just show the last executed functions, so you would need to reduce the batch size (or spatial size) a bit more.
Could you explain a bit, what “after the training” means? Are you able to train the model and the OOM error is raised later?