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

Error, But Only When Certain Image Combos Are Used #72

Open
spot92 opened this issue Jun 16, 2020 · 3 comments
Open

Error, But Only When Certain Image Combos Are Used #72

spot92 opened this issue Jun 16, 2020 · 3 comments

Comments

@spot92
Copy link

spot92 commented Jun 16, 2020

I get the following error, but only when using specific image combinations. I can use the content with other styles or style with other content. Very confusing.

Traceback (most recent call last):
File "D:\Neural Style Python\style_transfer_GUI.py", line 513, in
main()
File "D:\Neural Style Python\style_transfer_GUI.py", line 306, in main
optimizer.step(feval)
File "C:\Users\levic\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\optim\lbfgs.py", line 307, in step
orig_loss = closure()
File "D:\Neural Style Python\style_transfer_GUI.py", line 286, in feval
net(img)
File "C:\Users\levic\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py", line 541, in call
result = self.forward(*input, **kwargs)
File "C:\Users\levic\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\container.py", line 92, in forward
input = module(input)
File "C:\Users\levic\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py", line 541, in call
result = self.forward(*input, **kwargs)
File "C:\Users\levic\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\conv.py", line 345, in forward
return self.conv2d_forward(input, self.weight)
File "C:\Users\levic\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\conv.py", line 342, in conv2d_forward
self.padding, self.dilation, self.groups)
RuntimeError: CUDA out of memory. Tried to allocate 8.16 GiB (GPU 0; 11.00 GiB total capacity; 439.38 MiB already allocated; 8.16 GiB free; 126.62 MiB cached)

@ProGamerGov
Copy link
Owner

@spot92 I need more information to know if it's a neural-style-pt issue or a PyTorch/CUDA issue. If it's a PyTorch issue with the latest update, then trying to to simplify the code for reproducing the error will help their devs solve it.

Also, do any of the fixes in these issues solve things?

pytorch/pytorch#16417

https://discuss.pytorch.org/t/runtimeerror-cuda-out-of-memory-tried-to-allocate-1-12-mib-gpu-0-11-91-gib-total-capacity-5-52-gib-already-allocated-2-06-mib-free-184-00-kib-cached/42080/9

https://www.kaggle.com/c/jigsaw-unintended-bias-in-toxicity-classification/discussion/91081

@spot92
Copy link
Author

spot92 commented Jun 16, 2020

I'll look into them. I just thought it was weird that it only did it with specific combinations of images. Thanks!

@sawtl
Copy link

sawtl commented Aug 31, 2020

Looks like the Geforce limitation on the usable memory, about 70% of VRAM in Linux with Pytorch (1 GPU). Image max size depends on the framework and option, try to reduce it.

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