jcjohnson / fast-neural-style

Feedforward style transfer
4.29k stars 816 forks source link

resnet models don't produce results #159

Open agilebean opened 6 years ago

agilebean commented 6 years ago

Hi, I have tried using the ResNet models for torch provided by the Facebook distribution:

th slow_neural_style.lua -gpu 0 -use_cudnn 1 
-content_image /home/rstudio/sync-fns/input/jessica_alba1.jpg 
-style_image /home/rstudio/sync-fns/styles/cloth5.jpg 
-output_image /home/rstudio/sync-fns/output/resnet101-1-cloth5.png 
-num_iterations 1000 -print_every 10 -save_every 500 
-loss_network /home/rstudio/resnet-101.t7 
-preprocessing resnet

Unfortunately, they give me pictures only containing noise: resnet101-1-cloth5_1000

This is strange - using exactly the same code with the vgg16 model renders good results:

image

Do I have to convert the t7 model somehow??

agilebean commented 6 years ago

I found this in the log - maybe it gives a hint.

/home/rstudio/torch/install/bin/luajit: ./fast_neural_style/TotalVariation.lua:33: invalid arguments: CudaTensor nil
expected arguments: *CudaTensor* [CudaTensor] float | *CudaTensor* [CudaTensor] [float] CudaTensor
stack traceback:
[C]: in function 'add'
./fast_neural_style/TotalVariation.lua:33: in function 'updateGradInput'
/home/rstudio/torch/install/share/lua/5.1/nn/Module.lua:31: in function 'backward'
slow_neural_style.lua:130: in function 'opfunc'
/home/rstudio/torch/install/share/lua/5.1/optim/lbfgs.lua:66: in function 'lbfgs'
slow_neural_style.lua:156: in function 'main'
slow_neural_style.lua:172: in main chunk
[C]: in function 'dofile'
...udio/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x00405d50