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

Any low mem cmd option available #36

Open
muruga86 opened this issue Nov 30, 2021 · 4 comments
Open

Any low mem cmd option available #36

muruga86 opened this issue Nov 30, 2021 · 4 comments

Comments

@muruga86
Copy link

Hi,

I am trying to run the program on a ubnutu 20.4 machine with GTX1650Ti GPU, but face lack of memory issue.
Does this module have any low mem option i.e like reduce channel option with less memory requirement.
Or any other work around possible?

python3 test.py --input_dir inputimg --output_dir outputimg --device cuda
model loaded: ./weights/paprika.pt
Traceback (most recent call last):
File "test.py", line 92, in
test(args)
File "test.py", line 48, in test
out = net(image.to(device), args.upsample_align).cpu()
File "/home/murugan86/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/murugan86/anime/animagen-pytorch-mur/animegan2-pytorch/model.py", line 91, in forward
out = self.block_a(input)
File "/home/murugan86/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/murugan86/.local/lib/python3.8/site-packages/torch/nn/modules/container.py", line 117, in forward
input = module(input)
File "/home/murugan86/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/murugan86/.local/lib/python3.8/site-packages/torch/nn/modules/container.py", line 117, in forward
input = module(input)
File "/home/murugan86/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/murugan86/.local/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 423, in forward
return self._conv_forward(input, self.weight)
File "/home/murugan86/.local/lib/python3.8/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 7.96 GiB (GPU 0; 3.82 GiB total capacity; 2.07 GiB already allocated; 549.38 MiB free; 2.09 GiB reserved in total by PyTorch)

@bryandlee
Copy link
Owner

Try --device cpu

@muruga86
Copy link
Author

muruga86 commented Dec 1, 2021

when trying with cpu option getting output like this

python3 test.py --input_dir inputimg --output_dir outputimg --device cpu
model loaded: ./weights/paprika.pt
Killed

@bryandlee
Copy link
Owner

Seems like you don't have enough RAM as well.
Here are some possible options you can try:

  1. Use colab
  2. Try TensorRT conversion with FP16
  3. Downsize the image

@xermao
Copy link

xermao commented Dec 28, 2021

how to use TensorRT in animegan2-pytorch?

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

3 participants