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

Open
sumit2k4 opened this issue Aug 26, 2019 · 1 comment
Open

CUDA out of memory #9

sumit2k4 opened this issue Aug 26, 2019 · 1 comment

Comments

@sumit2k4
Copy link

sumit2k4 commented Aug 26, 2019

I preproceesed the data in matlab and generated the model file. Now in python i am getting this error:

############################################################

Video Super Resolution - Pytorch implementation

by Thang Vu (thangvubk@gmail.com

############################################################

-------YOUR SETTINGS_________
model: VRES
model_path: VRES_x3.pt
scale: 3
test_set: IndMya

Contructing dataset...
Testing...
Traceback (most recent call last):
File "/media/sumit/New Volume1/RnD/video-super-resolution-master/test.py", line 93, in
main()
File "/media/sumit/New Volume1/RnD/video-super-resolution-master/test.py", line 88, in main
stats, outputs = solver.test(train_dataset, args.model_path)
File "/media/sumit/New Volume1/RnD/video-super-resolution-master/solver.py", line 252, in test
_, _, stats, outputs = self._check_PSNR(dataset, is_test=True)
File "/media/sumit/New Volume1/RnD/video-super-resolution-master/solver.py", line 151, in _check_PSNR
output_batch = self.model(input_batch)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/media/sumit/New Volume1/RnD/video-super-resolution-master/model.py", line 81, in forward
out = self.residual_layer(out)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/container.py", line 92, in forward
input = module(input)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/media/sumit/New Volume1/RnD/video-super-resolution-master/model.py", line 94, in forward
return self.relu(self.conv(x))
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/conv.py", line 338, in forward
self.padding, self.dilation, self.groups)
RuntimeError: CUDA out of memory. Tried to allocate 128.00 MiB (GPU 0; 3.94 GiB total capacity; 3.12 GiB already allocated; 7.38 MiB free; 48.66 MiB cached)

My GPU is 4GB. Though I changed the batch size to 1 and number of workers to 0, I am getting out of memory error while performing both training and testing. May I know the GPU requirement please? or is there any way that I can process it with my current GPU?

@thangvubk
Copy link
Owner

I trained the networks on a 12GB GPU. You may reduce batch size if your GPU mem is not large enough. Check here

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