Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 5.80 GiB total capacity; 5.64 GiB already allocated; 15.69 MiB free; 5.65 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 #407

Open
yangcopnuli opened this issue Jul 31, 2023 · 3 comments

Comments

@yangcopnuli
Copy link

torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 5.80 GiB total capacity; 5.64 GiB already allocated; 15.69 MiB free; 5.65 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

@praetor29
Copy link

If you're running it in an interactive notebook, try restarting the environment. That'll free up memory.

@Knackii
Copy link

Knackii commented Aug 14, 2023

Try this it worked for me #315 (comment)

@asterocean
Copy link

I figured out a solution, load modules on demand rather than load them all at the same time, try this pull request: #531

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@asterocean @Knackii @praetor29 @yangcopnuli and others