xinntao / ESRGAN

ECCV18 Workshops - Enhanced SRGAN. Champion PIRM Challenge on Perceptual Super-Resolution. The training codes are in BasicSR.
https://github.com/xinntao/BasicSR
Apache License 2.0
5.97k stars 1.06k forks source link

CUDA runs out of memory #121

Open Hellstormer00 opened 3 years ago

Hellstormer00 commented 3 years ago

I tried running the test.py with my own 5mp photos. But apparently they are to big, because CUDA runs out of memory. I own a nvidia gtx 1080ti.

This is my error.

Traceback (most recent call last): File "C:\Users\alexa\Desktop\ESRGAN\test.py", line 41, in output = model(imgLR).data.squeeze().float().cpu().clamp(0, 1).numpy() File "C:\Users\alexa\anaconda3\envs\upscale\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl result = self.forward(*input, kwargs) File "C:\Users\alexa\Desktop\ESRGAN\RRDBNet_arch.py", line 71, in forward trunk = self.trunk_conv(self.RRDB_trunk(fea)) File "C:\Users\alexa\anaconda3\envs\upscale\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl result = self.forward(*input, *kwargs) File "C:\Users\alexa\anaconda3\envs\upscale\lib\site-packages\torch\nn\modules\container.py", line 117, in forward input = module(input) File "C:\Users\alexa\anaconda3\envs\upscale\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl result = self.forward(input, kwargs) File "C:\Users\alexa\Desktop\ESRGAN\RRDBNet_arch.py", line 47, in forward out = self.RDB1(x) File "C:\Users\alexa\anaconda3\envs\upscale\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl result = self.forward(*input, *kwargs) File "C:\Users\alexa\Desktop\ESRGAN\RRDBNet_arch.py", line 33, in forward x5 = self.conv5(torch.cat((x, x1, x2, x3, x4), 1)) File "C:\Users\alexa\anaconda3\envs\upscale\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl result = self.forward(input, **kwargs) File "C:\Users\alexa\anaconda3\envs\upscale\lib\site-packages\torch\nn\modules\conv.py", line 423, in forward return self._conv_forward(input, self.weight) File "C:\Users\alexa\anaconda3\envs\upscale\lib\site-packages\torch\nn\modules\conv.py", line 419, in _conv_forward return F.conv2d(input, weight, self.bias, self.stride, RuntimeError: CUDA out of memory. Tried to allocate 2.53 GiB (GPU 0; 11.00 GiB total capacity; 15.35 GiB already allocated; 0 bytes free; 16.62 GiB reserved in total by PyTorch)

Is there any easy way to fix this issue or do I just have not enough vram?

yjg123456 commented 3 years ago

same here ,do you solve it ?

crwg commented 3 years ago

the same, I'm just using cpu instead :|

Lufims commented 1 year ago

the same, I'm just using cpu instead :|

How are you doing that? I tried to use the cpu but the script doesn't work

crwg commented 1 year ago

the same, I'm just using cpu instead :|

How are you doing that? I tried to use the cpu but the script doesn't work

I just installed torch CPU version, but for now I using stable diffusion