crowsonkb / style_transfer

Data-parallel image stylization using Caffe.
MIT License
113 stars 14 forks source link

Speed issues #14

Closed raustaburk closed 7 years ago

raustaburk commented 7 years ago

Style Transfer seems to iterate much slower than Neural Style on my machine. I'm using a GeForce 1060 and Neural Style will create a 256px image at about 5-10 iterations per second, but Style Transfer is more like 5 seconds each.

Is there any way around this? Thanks

raustaburk commented 7 years ago

Recompiling Caffe with MKL brought it down to about 1s per step/iteration.

crowsonkb commented 7 years ago

If it gets that much faster with Caffe using MKL, are you sure you're using the GPU? You have to specify --devices 0 (or something else not -1) as CPU is the default.

crowsonkb commented 7 years ago

On GPU most of the speed benefits are seen with a MKL-compiled Numpy and it is not fivefold.

raustaburk commented 7 years ago

Thanks! I didn't realize CPU was the default, --devices 0 did the trick. I could never get anything out of neural style on a CPU, so in reality it seems like style transfer is actually faster under at least some conditions.

Might I suggest....