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 memory #44

Open
shersoni610 opened this issue Nov 24, 2019 · 4 comments
Open

Cuda memory #44

shersoni610 opened this issue Nov 24, 2019 · 4 comments

Comments

@shersoni610
Copy link

Hello,

I am trying to run pytorch example on 6GB Cuda card and I get the following message:

RuntimeError: CUDA out of memory. Tried to allocate 640.00 MiB (GPU 0; 5.94 GiB total capacity; 4.54 GiB already allocated; 415.44 MiB free; 143.32 MiB cached)

How can we run the examples on 6GB cards?

Thanks

@zxczrx123
Copy link

@shersoni610 I also had the same problem.
My environment:
Win10(I had changed some code so I can use it in Win10),
One 1080Ti,
Anaconda py3.6,Cuda 9.0,CUDNN 7.5,Pytorch1.1

I solved this problem by set num_workers=0 of DataLoader() in pytorch/main.py .And I also had try to smaller the batch size of train.But in the end I still use 32 and it works.

@shersoni610
Copy link
Author

shersoni610 commented Nov 27, 2019 via email

@nihil39
Copy link

nihil39 commented Sep 4, 2020

Hi, @shersoni610 @zxczrx123

i'm having the same problem on a meager GT 1030 (RuntimeError: CUDA out of memory. Tried to allocate 80.00 MiB (GPU 0; 1.95 GiB total capacity; 947.23 MiB already allocated; 24.25 MiB free; 1.02 GiB reserved in total by PyTorch)

Changing the number of workers does not help. By the way, what's the point on setting them to zero?

Any help with changing the batch size?

Thank you

@Racketycomic
Copy link

Setting the default value of test_batch_size argument in main.py from 16 to 8 worked for me

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

4 participants