caffe-with-spearmint icon indicating copy to clipboard operation
caffe-with-spearmint copied to clipboard

Fine-tuning

Open GiuliaP opened this issue 9 years ago • 2 comments

Hi @kuz,

I tried caffe-with-spearmint today and it seems really useful. Thanks for this work!!

I would like to use your code to optimize parameters in network fine-tuning rather than training from scratch. How can I do? Basically I just need to do 2 things:

  1. call the 'caffe train' API passing the weights of the pre-trained net to start from
  2. change the name of the layers that are learned from scratch (e.g. fc80 to fc8_newtask)

I think that if you can provide this feature or give some hints about this many people would appreciate it.

Thanks again!!!!! Giulia Pasquale

GiuliaP avatar Jan 27 '16 15:01 GiuliaP

Has anyone figured out a way to specify the base weights for fine-tuning? This would be really helpful!

avalada avatar Feb 08 '16 10:02 avalada

@GiuliaP @avalada I don't know if it's still useful for you guys, but it appears that you just need to modify line 73 in cafferun.py. Just add the weights parameter and you're good to go. :smiley:

For example: caffe_return_code = subprocess.call(CAFFE_ROOT + '/build/tools/caffe train --weights /path/to/your/source/model --solver ../tmp/%s_solver.prototxt 2> ../caffeout/%s_log.txt' % (prefix, prefix), shell=True)

mc-suchecki avatar Mar 21 '17 15:03 mc-suchecki