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
-contentSize 0 --> Out of memory #6
Comments
If anyone tried to reproduce this, please tell me what happened. If you could reproduce it, then we can see what's going on in the code. If you couldn't reproduce it, then I'll know to focus on my system's idiosyncrasies. Copy and paste the following for an easier test, after downloading the images:
|
Hi @MatthewKleinsmith, Yes, I tried out your images and was able to reproduce the error. GPU: Titan X Maxwell On debugging a bit, I found out that Line118 of
Next, I tried resizing the content image and On thinking a bit, this makes perfect sense. It is just as it says, your GPU ran out of memory. Your content image is too big for the decoder CNN. If you read the paper Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization it says that the authors used first few layers of VGG19 as encoder and its inverse for decoder. Hence, the decoder/encoder is a fully convolutional network and thus can adapt itself to input of any arbitrary size. The original paper on FCN has more details regarding this. So, when your image becomes too big like in your case, torch is unable to allocate memory for your network and it throws an error. |
Use |
@armoreal you are using CPU right? I think on a 12GB GPU (Titan X), max of 500,000 pixels can be processed for this decoder. |
Yes, i use GPU for resolution lower than 512x512px and CPU for resolution up to 1600x1600px. |
Thanks, I'll look at it later. |
@gsssrao |
@dovanchan In this video I have results with various videos not just cartoon. The only additional dependency to run the video stylization is ffmpeg . If you have installed this, you should not experience any other problems if AdaIN style for images was working. |
Goal
To make the output image size the same as as the content image size.
Attempt
th test.lua -content mushka_cat0159.jpg -style dark_matter_bw.png -contentSize 0
Error
Out of memory
[stack traceback omitted]
Setup
Content image
1280x720
25,840 bytes
Download
Style image
512x512
469,165 bytes
Download
GPU
Titan X Pascal
Other attempts
th test.lua -content mushka_cat0159.jpg -style dark_matter_bw.png
Result: output image size: 912x512 (i.e. different than the content image size, 1280x720)
th test.lua -content mushka_cat0159.jpg -style dark_matter_bw.png -contentSize 720
Result: out of memory
The text was updated successfully, but these errors were encountered: