Hello,
I have the same problem as my GPU memory usage increases on the nvidia-smi output while torch.cuda.memory_allocated('cuda:0') always outputs the same value.
I already use del loss and detach_() some tensor after the backward() call.
Still I never get OOM error as my training always reaches its end.
Thank you