liif icon indicating copy to clipboard operation
liif copied to clipboard

Met with cuda out of memory when I am testing the model

Open Patricia1019 opened this issue 3 years ago • 5 comments

bash scripts/test-div2k.sh save/_train_edsr-baseline-liif/epoch-last.pth 0 then I met with RuntimeError: CUDA out of memory. Tried to allocate 676.00 MiB (GPU 0; 10.92 GiB total capacity; 827.98 MiB already allocated; 478.50 MiB free; 830.00 MiB reserved in total by PyTorch) how to solve this problem?

Patricia1019 avatar Jul 10 '21 06:07 Patricia1019

try reducing the batch size.

sangjun04 avatar Jul 15 '21 06:07 sangjun04

i met the same error(cuda oom) when test rdn-liif. did you solve this problem?

xuejiancai avatar Aug 13 '21 11:08 xuejiancai

I have 4 GPU. But when I run code on GPU:2 ,I run this 'CUDA_VISIBLE_DEVICES=2 python demo.py --input 246.jpg --model rdn-liif.pth --resolution 2560,1440 --output output.png --gpu 0' and get 'cuda out of memory'. Than I try 'CUDA_VISIBLE_DEVICES=2 python demo.py --input 246.jpg --model rdn-liif.pth --resolution 1440,2560 --output output.png --gpu 2'. It work!!!

Lovegood-1 avatar Dec 05 '21 01:12 Lovegood-1

try reducing the batch size.

I tried to reduce the batch size to 1, but it didn't work.

Irina51244 avatar Nov 14 '22 07:11 Irina51244

I have 4 GPU. But when I run code on GPU:2 ,I run this 'CUDA_VISIBLE_DEVICES=2 python demo.py --input 246.jpg --model rdn-liif.pth --resolution 2560,1440 --output output.png --gpu 0' and get 'cuda out of memory'. Than I try 'CUDA_VISIBLE_DEVICES=2 python demo.py --input 246.jpg --model rdn-liif.pth --resolution 1440,2560 --output output.png --gpu 2'. It work!!!

I set the number of GPU to '1', but it still used GPU'0'. RuntimeError: CUDA out of memory. Tried to allocate 4.46 GiB (GPU 0; 11.00 GiB total capacity; 6.84 GiB already allocated; 1.27 GiB free; 7.97 GiB reserved in total by PyTorch)

Irina51244 avatar Nov 14 '22 07:11 Irina51244