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 error: out of memory #46

Open
YogaLYJ opened this issue Feb 28, 2019 · 3 comments
Open

CUDA error: out of memory #46

YogaLYJ opened this issue Feb 28, 2019 · 3 comments

Comments

@YogaLYJ
Copy link

YogaLYJ commented Feb 28, 2019

Thank u for ur nice work! I run train.py under python2.7 pytorch0.4.1, 12G GPU, but get the following error:

Traceback (most recent call last):
File "/home/.../PycharmProjects/sphereface_pytorch-master/train.py", line 134, in
net.cuda()
File "/home/.../anaconda3/envs/python2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 258, in cuda
return self._apply(lambda t: t.cuda(device))
File "/home/.../anaconda3/envs/python2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 185, in _apply
module._apply(fn)
File "/home/.../anaconda3/envs/python2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 191, in _apply
param.data = fn(param.data)
File "/home/.../anaconda3/envs/python2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 258, in
return self._apply(lambda t: t.cuda(device))
RuntimeError: CUDA error: out of memory

How could I run it successfuly?

@Pengyang233
Copy link

net.cuda(device = x), x is your gpu number you want to use

@chaochao12345lala
Copy link

内存不够导致的

@SherrySwift
Copy link

I met the same problem, how did you solve it?

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