Would dataloader use gpu memory?

When I train a model, I set batchsize to 28 and find that it works fine. However, when I use dataloader to generate training data, I get ‘cuda runtime error (2) : out of memory’ and have to decrease the batchsize. I am not sure whether dataloder is the reason of this problem. Can someone help me?

dataloader doesn’t use gpu memory.