ESRGAN icon indicating copy to clipboard operation
ESRGAN copied to clipboard

CUDA runs out of memory

Open Hellstormer00 opened this issue 3 years ago • 4 comments

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(img_LR).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?

Hellstormer00 avatar Apr 27 '21 13:04 Hellstormer00

same here ,do you solve it ?

yjg123456 avatar May 20 '21 00:05 yjg123456

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

crwg avatar Aug 17 '21 09:08 crwg

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

Lufims avatar Jan 10 '23 14:01 Lufims

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

crwg avatar May 12 '23 17:05 crwg