2

I'm replicating the steps in http://caffe.berkeleyvision.org/gathered/examples/finetune_flickr_style.html

I want to change the network to VGG model which is obtained at http://www.robots.ox.ac.uk/~vgg/software/very_deep/caffe/VGG_ILSVRC_16_layers.caffemodel

does it suffice to simply substitute the model parameter as following?

./build/tools/caffe train -solver models/finetune_flickr_style/solver.prototxt -weights VGG_ISLVRC_16_layers.caffemodel -gpu 0

Or do I need to adjust learning rates, iterations, i.e. does it come with separate prototxt files?

stop-cran
  • 4,229
  • 2
  • 30
  • 47
ytrewq
  • 3,670
  • 9
  • 42
  • 71

1 Answers1

5

There needs to be a 1-1 correspondence between the weights of the network you want to train and the weights you use for initializing/fine-tuning. The architecture of the old and new model have to match.

VGG-16 has a different architecture than the model described by models/finetune_flickr_style/train_val.prototxt (FlickrStyleCaffeNet). This is the network that the solver will try to optimize. Even if it doesn't crash, the weights you've loaded don't have any meaning in the new network.

The VGG-16 network is described in the deploy.prototxt file on this page in Caffe's Model Zoo.

ypx
  • 1,459
  • 11
  • 19
  • Are there train_val.prototxt and solver.protxt for VGG? I'm unable to find one except the one described in your link, which people say doesn't work. – ytrewq Sep 22 '15 at 15:43
  • 1
    Haven't come across a train_val for VGG-16 yet. Looking at [karpathy's](https://gist.github.com/ksimonyan/211839e770f7b538e2d8#gistcomment-1403727) train_val, it seems the prototxt is somewhat outdated. You're going to end up with zero weights that won't change during training. You'll need to add initialization parameters throughout the network. A simple option is something like weight_filler { type: "gaussian" std: 0.01 } bias_filler { type: "constant" value: 0 } but I recommend checking out the VGG-16 paper on what initialization was used by the authors. – ypx Sep 22 '15 at 16:43