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. Tried to allocate 20.00 MiB (GPU 0; 2.00 GiB total capacity; 1.26 GiB already allocated; 9.93 MiB free; 1.33 GiB reserved in total by PyTorch) #382

Open
sharqawiDev opened this issue Feb 11, 2020 · 2 comments

Comments

@sharqawiDev
Copy link

I try to use Background-Removal.py from app-seperation-semseg/ to remove the background from some images on my device, but I always get this error:
1

My specs:

  • OS: Windows 10
  • Env: Anaconda (and conda as a package manager).
  • GPU:
    2

I found this replay on someone having the same issue:

pytorch/pytorch#16417 (comment)

but I don't know how to decrease the batch size.

I appreciate any help.

@BT-julio
Copy link

BT-julio commented Aug 4, 2020

j'ai le même problème mais je ne sais pas encore comment le resourdre
Epoch gpu_mem GIoU obj cls total targets img_size
0% 0/32 [00:00<?, ?it/s]/usr/local/lib/python3.6/dist-packages/torch/cuda/memory.py:346: FutureWarning: torch.cuda.memory_cached has been renamed to torch.cuda.memory_reserved
FutureWarning)
0/299 13.3G 4.74 4.03 0 8.78 24 576: 62% 20/32 [00:37<00:16, 1.39s/it]Traceback (most recent call last):
File "train.py", line 414, in
train(hyp) # train normally
File "train.py", line 264, in train
pred = model(imgs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/content/drive/My Drive/2020_Julio_Yolo_projet/yolov3/models.py", line 238, in forward
return self.forward_once(x)
File "/content/drive/My Drive/2020_Julio_Yolo_projet/yolov3/models.py", line 292, in forward_once
x = module(x)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/container.py", line 117, in forward
input = module(input)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/conv.py", line 419, in forward
return self._conv_forward(input, self.weight)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/conv.py", line 416, in _conv_forward
self.padding, self.dilation, self.groups)
RuntimeError: CUDA out of memory. Tried to allocate 50.00 MiB (GPU 0; 14.73 GiB total capacity; 13.57 GiB already allocated; 17.88 MiB free; 13.72 GiB reserved in total by PyTorch)
0/299 13.3G 4.74 4.03 0 8.78 24 576: 62% 20/32 [00:40<00:24, 2.01s/it]

@pasquale90
Copy link

My problem solved by reducing the size of the input video..

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

3 participants