clcarwin / sphereface_pytorch

A PyTorch Implementation of SphereFace.
MIT License
714 stars 172 forks source link

CUDA error: out of memory #46

Open YogaLYJ opened 5 years ago

YogaLYJ commented 5 years ago

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 commented 5 years ago

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

chaochao12345lala commented 4 years ago

内存不够导致的

SherrySwift commented 3 years ago

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