jcjohnson / neural-style

Torch implementation of neural style algorithm
MIT License
18.3k stars 2.71k forks source link

SqueezeNet Model? #473

Open 3DTOPO opened 5 years ago

3DTOPO commented 5 years ago

I am trying to get decent results with SqueezeNet (its only 5MB and has AlexNet level accuracy!). I downloaded the models from here: https://github.com/DeepScale/SqueezeNet

I am able to use any of the first 3 layers (from either v1.0 or v1.1 of the model), but I am not able to get any interesting results with the first 3 layers.

Here is the result using the first 3 layers for both style and content layers: out

Command used: layers=conv1,fire2/squeeze1x1,fire2/expand1x1 th neural_style.lua -style_image starry_night.jpg -content_image tubingen.jpg -gpu 0 -model_file squeezenet_v1.0.caffemodel -proto_file squeezenet_train_val.prototxt -content_layers $layers -style_layers $layers

If I attempt to use any layers past the first three I get an error message like this: /home/jeshua/src/torch/install/share/lua/5.1/nn/THNN.lua:110: Need input of dimension 3 and input.size[0] == 16 but got input to be of shape: [64 x 94 x 126] at /home/jeshua/src/torch/extra/cunn/lib/THCUNN/generic/SpatialConvolutionMM.cu:49

Here are all the layers in the model: conv1: 96 3 7 7 fire2/squeeze1x1: 16 96 1 1 fire2/expand1x1: 64 16 1 1 fire2/expand3x3: 64 16 3 3 fire3/squeeze1x1: 16 128 1 1 fire3/expand1x1: 64 16 1 1 fire3/expand3x3: 64 16 3 3 fire4/squeeze1x1: 32 128 1 1 fire4/expand1x1: 128 32 1 1 fire4/expand3x3: 128 32 3 3 fire5/squeeze1x1: 32 256 1 1 fire5/expand1x1: 128 32 1 1 fire5/expand3x3: 128 32 3 3 fire6/squeeze1x1: 48 256 1 1 fire6/expand1x1: 192 48 1 1 fire6/expand3x3: 192 48 3 3 fire7/squeeze1x1: 48 384 1 1 fire7/expand1x1: 192 48 1 1 fire7/expand3x3: 192 48 3 3 fire8/squeeze1x1: 64 384 1 1 fire8/expand1x1: 256 64 1 1 fire8/expand3x3: 256 64 3 3 fire9/squeeze1x1: 64 512 1 1 fire9/expand1x1: 256 64 1 1 fire9/expand3x3: 256 64 3 3

Note that I get these warnings: Successfully loaded models/SqueezeNet_v1.0/squeezenet_v1.0.caffemodel warning: module 'data [type Data]' not found warning: module 'fire2/squeeze1x1_fire2/relu_squeeze1x1_0_split [type Split]' not found warning: module 'fire2/concat [type Concat]' not found warning: module 'fire3/squeeze1x1_fire3/relu_squeeze1x1_0_split [type Split]' not found warning: module 'fire3/concat [type Concat]' not found warning: module 'fire4/squeeze1x1_fire4/relu_squeeze1x1_0_split [type Split]' not found warning: module 'fire4/concat [type Concat]' not found warning: module 'fire5/squeeze1x1_fire5/relu_squeeze1x1_0_split [type Split]' not found warning: module 'fire5/concat [type Concat]' not found warning: module 'fire6/squeeze1x1_fire6/relu_squeeze1x1_0_split [type Split]' not found warning: module 'fire6/concat [type Concat]' not found warning: module 'fire7/squeeze1x1_fire7/relu_squeeze1x1_0_split [type Split]' not found warning: module 'fire7/concat [type Concat]' not found warning: module 'fire8/squeeze1x1_fire8/relu_squeeze1x1_0_split [type Split]' not found warning: module 'fire8/concat [type Concat]' not found warning: module 'fire9/squeeze1x1_fire9/relu_squeeze1x1_0_split [type Split]' not found warning: module 'fire9/concat [type Concat]' not found

Any suggestions to get more of the layers would be super appreciated! Is it feasible?