You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While following the step to replicate ViT model, I have an OutOfMemoryError during training.
OutOfMemoryError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 6.00 GiB total capacity; 5.28 GiB already allocated; 0 bytes free; 5.35 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
I tried to change the batch size to 1 / gc.collect() torch.cuda.empty_cache() / os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'max_split_size_mb=100' / restart the notebook but all of this is not working.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
While following the step to replicate ViT model, I have an OutOfMemoryError during training.
OutOfMemoryError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 6.00 GiB total capacity; 5.28 GiB already allocated; 0 bytes free; 5.35 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
I tried to change the batch size to 1 / gc.collect() torch.cuda.empty_cache() / os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'max_split_size_mb=100' / restart the notebook but all of this is not working.
How can I solve this error?
Beta Was this translation helpful? Give feedback.
All reactions