Could you reduce the batch size to a single sample and rerun the code, in case your current batch size is larger?
If that doesn’t help, could you remove the data loading as a debugging step and feed a single sample as x = torch.randn(...) to the model to check the memory usage?