caffe-with-spearmint
caffe-with-spearmint copied to clipboard
Fine-tuning
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:
- call the 'caffe train' API passing the weights of the pre-trained net to start from
- change the name of the layers that are learned from scratch (e.g.
fc80
tofc8_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
Has anyone figured out a way to specify the base weights for fine-tuning? This would be really helpful!
@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)