Sanjana Nair
Sanjana Nair

Reputation: 2785

Out of memory issue - I have 6 GB GPU Card, 5.24 GiB reserved in total by PyTorch

I have tried all the ways given on the web but still getting the same error:

OutOfMemoryError: CUDA out of memory. Tried to allocate 78.00 MiB (GPU 0; 6.00 GiB total capacity; 5.17 GiB already allocated; 0 bytes free; 5.24 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

The dataset is a huge text set. No images etc.

I am struggling for last 2 days. I am not able to fix this issue. Can somebody help me out?

Thanks!

Upvotes: 2

Views: 3485

Answers (1)

Toyo
Toyo

Reputation: 751

It does not matter if there are images or not.
You have a huge dataset. Without the code/dataset in your questions, I can't really give you an answer.
However, what I can think of is:

  • Your batch size is too big. Then reduce it.
  • Try using tensors in FP16 definition.
  • Get another GPU with larger memory or if you have more than one GPU, split the training on them.

Upvotes: 1

Related Questions