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 out of memory. #60

Open
StetchPlane opened this issue Dec 27, 2019 · 2 comments
Open

RuntimeError: CUDA out of memory. #60

StetchPlane opened this issue Dec 27, 2019 · 2 comments

Comments

@StetchPlane
Copy link

pytorch=1.10
cuda=9.0
This error is displaying while running "python widerface_val.py"
Can you tell me where the problem is?

Testing image 1/3226 0_Parade_marchingband_1_465.jpg....
Traceback (most recent call last):
File "widerface_val.py", line 306, in
test_widerface()
File "widerface_val.py", line 293, in test_widerface
[det2, det3] = multi_scale_test(image, max_im_shrink)#min(2,1400/min(image.shape[0],image.shape[1]))) #multi-scale test
File "widerface_val.py", line 104, in multi_scale_test
det_b = detect_face(image, bt)
File "widerface_val.py", line 60, in detect_face
y = net(x)
File "/home/cqupt/.conda/envs/w_py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/home/cqupt/.conda/envs/w_py36/FaceDetection-DSFD/face_ssd.py", line 238, in forward
conv5_3_x = self.layer3(conv4_3_x)
File "/home/cqupt/.conda/envs/w_py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/home/cqupt/.conda/envs/w_py36/lib/python3.6/site-packages/torch/nn/modules/container.py", line 92, in forward
input = module(input)
File "/home/cqupt/.conda/envs/w_py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/home/cqupt/.conda/envs/w_py36/lib/python3.6/site-packages/torch/nn/modules/container.py", line 92, in forward
input = module(input)
File "/home/cqupt/.conda/envs/w_py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/home/cqupt/.conda/envs/w_py36/lib/python3.6/site-packages/torchvision/models/resnet.py", line 98, in forward
out = self.conv2(out)
File "/home/cqupt/.conda/envs/w_py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/home/cqupt/.conda/envs/w_py36/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 338, in forward
self.padding, self.dilation, self.groups)
RuntimeError: CUDA out of memory. Tried to allocate 12.00 MiB (GPU 0; 10.76 GiB total capacity; 9.63 GiB already allocated; 7.06 MiB free; 358.29 MiB cached)

@swordlidev
Copy link
Contributor

Your pytorch is 1.10, our pytorch is 0.3.
If you just want to do evaluation, add torch.set_grad_enabled(False) inside test_oneimage() function (at the beginning of the function).

@StetchPlane
Copy link
Author

Can you tell me the specific version of Python you use?

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

2 participants