Lornatang / UGATIT-PyTorch

Simple, fast and easy to read. Yes, we use the pytorch framework!
Apache License 2.0
29 stars 5 forks source link

Cuda out of Memory #7

Open sinagh72 opened 2 years ago

sinagh72 commented 2 years ago

Hi,

I tried to run the code using 1050ti, but I get this error:

File "E:\UGATIT-PyTorch-master2\ugatit_pytorch\model.py", line 31, in forward out = self.rho.expand(x.shape[0], -1, -1, -1) out_in + (1 - self.rho.expand(x.shape[0], -1, -1, -1)) out_ln RuntimeError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 4.00 GiB total capacity; 3.44 GiB already allocated; 0 bytes free; 3.50 GiB reserved in total by PyTorch)

Is there any way to solve this issue?

kirill-ionkin commented 1 year ago

Hi,

I tried to run the code using 1050ti, but I get this error:

File "E:\UGATIT-PyTorch-master2\ugatit_pytorch\model.py", line 31, in forward out = self.rho.expand(x.shape[0], -1, -1, -1) out_in + (1 - self.rho.expand(x.shape[0], -1, -1, -1)) out_ln RuntimeError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 4.00 GiB total capacity; 3.44 GiB already allocated; 0 bytes free; 3.50 GiB reserved in total by PyTorch)

Is there any way to solve this issue?

@sinagh72 Hi, i'm not an expert. but i think you need more powerful(more gpu memory) gpu on your pc, because forward pass need a lot of resources.

I think, one of most usefull solution is just training on multiple gpu's, but of course you need multiple gpu's to do that.