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

Memory issue #57

Closed
vidda13 opened this issue Oct 1, 2015 · 7 comments
Closed

Memory issue #57

vidda13 opened this issue Oct 1, 2015 · 7 comments

Comments

@vidda13
Copy link

vidda13 commented Oct 1, 2015

I am trying to run the network on GTX 720 and i get the following issue
torch/install/share/lua/5.1/nn/utils.lua:11: cuda runtime error (2) : out of memory at /tmp/luarocks_cutorch-scm-1-2463/cutorch/lib/THC/THCStorage.cu:44
stack traceback:
[C]: in function 'resize'
torch/install/share/lua/5.1/nn/utils.lua:11: in function 'torch_Storage_type'
torch/install/share/lua/5.1/nn/utils.lua:57: in function 'recursiveType'
torch/install/share/lua/5.1/nn/Module.lua:123: in function 'type

I tried using smaller image_size and went to a size of 28 too. But it still doesn't work. Any suggestions what parameters I can tweak?

@hughperkins
Copy link
Contributor

I have a 1GB card, and runs just fine. I'm using the normalised vgg 19 though, not the original version. normalised hsa no fc layers, which saves 450MB or so. (ps, I can train up to size 200 just fine, with 1GB; size 256 runs out of memory for me; using lbfgs)

@vidda13
Copy link
Author

vidda13 commented Oct 1, 2015

ok.. did you use the same hyper-parameters? The GTX 720 has 2GB. Any idea how much memory reducing an image size can save?

@hughperkins
Copy link
Contributor

try these: #44 (comment)

th neural_style.lua -style_image examples/inputs/picasso_selfport1907.jpg -content_image examples/inputs/brad_pitt.jpg -gpu 0 -output_image profile.png -image_size 200 -model_file models/vgg_normalised.caffemodel -num_iterations 1000 -save_iter 50 -normalize_gradients -content_weight 50000 -style_weight 90000

@vidda13
Copy link
Author

vidda13 commented Oct 1, 2015

Well I guess the issue lies elsewhere. As i get the same error at cuda runtime error (2) : out of memory at /tmp/luarocks_cutorch-scm-1-2463/cutorch/lib/THC/THCStorage.cu:44.

@hughperkins
Copy link
Contributor

Ah, then I'm out of ideas. (other than basic things like: did you make sure to upgrade all of: nn, torch7, cutorch, cunn, inn? are you using cuda7?) (oh wait, is this gpu being used for your display/monitor too? is it possible that your monitor usage is somehow using all your memory? maybe you can use nvidia-smi to check how much memory is available when neural_style is not runnign?)

@vidda13
Copy link
Author

vidda13 commented Oct 1, 2015

Yikes. Some process was clogging 1.5GB of the memory. Seems to be running fine now when I restarted my system. Thanks.

@vidda13 vidda13 closed this as completed Oct 1, 2015
@hughperkins
Copy link
Contributor

:-)

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

2 participants