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

RuntimeError: CUDA error: out of memory #5

Open
damtharvey opened this issue Nov 27, 2018 · 6 comments
Open

RuntimeError: CUDA error: out of memory #5

damtharvey opened this issue Nov 27, 2018 · 6 comments

Comments

@damtharvey
Copy link

How much memory do I need for Capitals64? I have 11 GB.

@azadis
Copy link
Owner

azadis commented Nov 28, 2018

That should be enough. Do you have a batch size larger than 150?

@damtharvey
Copy link
Author

Sorry for the slow reply. I will try again when I get my GPU back after NIPS.

@sesebuckin
Copy link

I have 11GB too. I tried to train Capitals64 with batch size=150, but CUDA out of memory.
There's no problem with batch size=64. (batch size=120 will fails too. I haven't try size between 64 and 120)

@damtharvey
Copy link
Author

damtharvey commented Jan 14, 2019

I'm back. Trying it again, it seems like it doesn't use my GPU anymore.

I found the previous base_options.py and reverted to it. Tried it again with batch sizes 64 and 1 and still get CUDA error: out of memory.

@azadis
Copy link
Owner

azadis commented Jan 16, 2019

the issue of not using GPU is fixed now!
I am not sure about your cuda out of memory error. Can yoy provide more details?

@leitianqi
Copy link

@azadis
How can I solve this problem?

Total number of parameters: 291649

model [cGANModel] was created
create web directory ./checkpoints/GlyphNet_pretrain/web...
Traceback (most recent call last):
File "train.py", line 32, in
model.optimize_parameters()
File "/home/ltq/FontTransfer/MC-GAN/models/cGAN_model.py", line 242, in optimize_parameters
self.backward_G()
File "/home/ltq/FontTransfer/MC-GAN/models/cGAN_model.py", line 224, in backward_G
self.loss_G.backward()
File "/usr/local/lib/python2.7/dist-packages/torch/tensor.py", line 93, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "/usr/local/lib/python2.7/dist-packages/torch/autograd/init.py", line 90, in backward
allow_unreachable=True) # allow_unreachable flag
RuntimeError: CUDA error: 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

4 participants