jcjohnson / neural-style

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

loading other caffemodel #70

Open at0mb0y opened 9 years ago

at0mb0y commented 9 years ago

Hello,

this is a very cool work, I have lots of fun with. I'm curious to see what happen with different model. Is it changing something ? This not really an issue but I've try with «places205CNN» model but there is problem during the loading. MODULE data UNDEFINED warning: module 'data [type 5]' not found nn supports no groups! warning: module 'conv2 [type 4]' not found nn supports no groups! warning: module 'conv4 [type 4]' not found nn supports no groups! warning: module 'conv5 [type 4]' not found conv1: 96 3 11 11 conv3: 384 256 3 3 fc6: 1 1 9216 4096 fc7: 1 1 4096 4096 fc8: 1 1 4096 205 /home/at0mb0y/torch/install/bin/luajit: /home/at0mb0y/torch/install/share/lua/5.1/nn/Sequential.lua:44: bad argument #1 to 'updateOutput' (input channels and nInputPlane dont match) stack traceback: [C]: in function 'updateOutput' /home/at0mb0y/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward' neural_style.lua:205: in function 'main' neural_style.lua:439: in main chunk [C]: in function 'dofile' ...mb0y/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:131: in main chunk [C]: at 0x00406670

I guess that missing module break the connection. can I merely fix it by adding a làyer in the generated lua file. I guess I'll have trouble because it needs to map the weigth. I don't see from where the weight are extracted. any hint to make this work ?

best regard

at0mb0y commented 9 years ago

I've found that using cudnn instead of nn works better. but still one layer is missing : Successfully loaded models/places205CNN_iter_300000_upgraded.caffemodel MODULE data UNDEFINED warning: module 'data [type 5]' not found conv1: 96 3 11 11 conv2: 256 48 5 5 conv3: 384 256 3 3 conv4: 384 192 3 3 conv5: 256 192 3 3 fc6: 1 1 9216 4096 fc7: 1 1 4096 4096 fc8: 1 1 4096 205 /home/at0mb0y/torch/install/bin/luajit: /home/at0mb0y/torch/install/share/lua/5.1/nn/Linear.lua:39: size mismatch at /tmp/luarocks_cutorch-scm-1-2322/cutorch/lib/THC/THCTensorMathBlas.cu:36 stack traceback: [C]: in function 'addmv' /home/at0mb0y/torch/install/share/lua/5.1/nn/Linear.lua:39: in function 'updateOutput' /home/at0mb0y/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward' neural_style.lua:205: in function 'main' neural_style.lua:439: in main chunk [C]: in function 'dofile' ...mb0y/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:131: in main chunk [C]: at 0x00406670

hughperkins commented 8 years ago

I think you can ignore the error about data[type 5] not found, as far as I know. I think the error about size mismatch is because you are trying to use an image size that is too small, so after going through the various convolutional layers, it is less than 1x1, hence the error. You could try using a size of 256 or so, see if thta works better?