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

Cuda Out Of Memory when invoking train.py #49

Open
yelou-renni opened this issue Mar 22, 2021 · 3 comments
Open

Cuda Out Of Memory when invoking train.py #49

yelou-renni opened this issue Mar 22, 2021 · 3 comments

Comments

@yelou-renni
Copy link

Hi, I was trying to generate embeddings from a very small subset of VoxCeleb dataset (around 200 MB). The process created a training_data.npz file (around 2 GB), which was loaded in the training process (using uis-rnn). However, I encountered this error:

RuntimeError: CUDA out of memory. Tried to allocate 27.45 GiB (GPU 1; 39.59 GiB total capacity; 18.75 GiB already allocated; 19.56 GiB free; 18.77 GiB reserved in total by PyTorch)

The error does not occur when I try with a smaller file. Any idea how to resolve this issue? Thank you in advanced.

@taylorlu
Copy link
Owner

Well, please check if there is another process was in running and you forget to kill, this program should not occupy so much memory.

@yelou-renni
Copy link
Author

Thank you for your prompt response :) I was modifying the code to set the allow_pickle to True, but I've reverted it back to your original code and downgraded the pytorch & numpy version instead. However, the error still occurred with a much smaller size of the allocation request:

RuntimeError: CUDA out of memory. Tried to allocate 2.31 GiB (GPU 0; 39.59 GiB total capacity; 37.57 GiB already allocated; 997.19 MiB free; 1016.00 KiB cached)

Is this the normal size for a 2GiB input? I'm not sure where the 37.57 GiB memory is allocated. There was no other process that running at the same time. Btw, what is the maximum size of the input training_data.npz file that you've tried to train?

@SanaullahOfficial
Copy link

Hi @yelou-renni, did you get the solution? I am facing the same issue, CUDA out of memory.

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

3 participants