jcjohnson / neural-style

Torch implementation of neural style algorithm
MIT License
18.31k stars 2.7k forks source link

System freezes #60

Open StrangeTcy opened 8 years ago

StrangeTcy commented 8 years ago

On Ubuntu 14.04 x64 with 4 GB of RAM and a 16 GB swap I try running

`cd ~/neural-style
`th neural_style.lua -gpu -1 -style_image ./examples/inputs/starry_night.jpg,./examples/inputs/the_scream.jpg -content_image Creacion.jpg -image_size 512 -output_image weird_creation.png -model_file ./models/VGG_ILSVRC_19_layers.caffemodel

I don't have a videocard, except a built-in Intel® G41, and the CPU is Pentium Dual-Core CPU E5700 @ 3.00GHz.

It gets as far as loading layer 2 out of 30, and then the whole system freezes. It should probably be noted that the same works for -image_size 256, although it takes several hours to calculate and doesn't look too impressive (that is, nice, but too small to see the details).

jcjohnson commented 8 years ago

Try adding -print_iter 1 to make it print progress every iteration; it might just be very slow.

Also it's possible that you have filled up your RAM and are swapping to disk, which could be extremely slow; you should be able check that in your system monitor.

StrangeTcy commented 8 years ago

Ok, this is not an issue with neuralstyle per se, it's an issue with Ubuntu and how it handles "normal" swaps versus encrypted swaps.

StrangeTcy commented 8 years ago

By my current estimation, each iteration takes about 15 seconds. Thanks for suggesting the -print_iter.

jcjohnson commented 8 years ago

Wow that's very slow - usually you start getting decent results only after a few hundred iterations.

To reduce memory usage you could try using the ADAM optimizer instead of LBFGS, but then you'll have to play a bit with the learning rate.

StrangeTcy commented 8 years ago

I'm getting decent results already, I just wish to go through all iterations. As for speed and memory usage, I'm saving up for some g2xlarge time :-)