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

torch.cuda.OutOfMemoryError #18

Open
staystupidstayfoolish opened this issue Apr 1, 2024 · 0 comments
Open

torch.cuda.OutOfMemoryError #18

staystupidstayfoolish opened this issue Apr 1, 2024 · 0 comments

Comments

@staystupidstayfoolish
Copy link

the error appear when the test loop iterate to the second batch. Are there any other solutions to this problem besides changing to a different graphics card?

image

(pcrenv) steve@steve-Lenovo-Legion-R7000P2021:~/graduation_project/pcrnet_pytorch-master/pcrnet_pytorch-master$ python test_pcrnet.py
1%|▎ | 1/124 [00:23<47:51, 23.34s/it]
Traceback (most recent call last):
File "/home/steve/graduation_project/pcrnet_pytorch-master/pcrnet_pytorch-master/test_pcrnet.py", line 161, in
main()
File "/home/steve/graduation_project/pcrnet_pytorch-master/pcrnet_pytorch-master/test_pcrnet.py", line 158, in main
test(args, model, test_loader)
File "/home/steve/graduation_project/pcrnet_pytorch-master/pcrnet_pytorch-master/test_pcrnet.py", line 102, in test
test_loss, translation_error, rotation_error = test_one_epoch(args.device, model, test_loader)
File "/home/steve/graduation_project/pcrnet_pytorch-master/pcrnet_pytorch-master/test_pcrnet.py", line 82, in test_one_epoch
output = model(template, source)
File "/home/steve/graduation_project/pcrenv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/steve/graduation_project/pcrnet_pytorch-master/pcrnet_pytorch-master/pcrnet/models/pcrnet.py", line 58, in forward
est_R, est_t, source = self.spam(template_features, source, est_R, est_t)
File "/home/steve/graduation_project/pcrnet_pytorch-master/pcrnet_pytorch-master/pcrnet/models/pcrnet.py", line 31, in spam
self.source_features = self.pooling(self.feature_model(source))
File "/home/steve/graduation_project/pcrenv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/steve/graduation_project/pcrnet_pytorch-master/pcrnet_pytorch-master/pcrnet/models/pointnet.py", line 47, in forward
output = layer(output)
File "/home/steve/graduation_project/pcrenv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/steve/graduation_project/pcrenv/lib/python3.10/site-packages/torch/nn/modules/activation.py", line 103, in forward
return F.relu(input, inplace=self.inplace)
File "/home/steve/graduation_project/pcrenv/lib/python3.10/site-packages/torch/nn/functional.py", line 1457, in relu
result = torch.relu(input)
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 160.00 MiB (GPU 0; 3.80 GiB total capacity; 3.34 GiB already allocated; 67.50 MiB free; 3.41 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
(pcrenv) steve@steve-Lenovo-Leg

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

1 participant