cerebrou
cerebrou

Reputation: 5540

How to load caffemodel weights for retraining using Pycaffe?

How to load caffemodel weights (alongside with a solver) to use subsequently for retraining using Python?

In other words, what would be the counterpart of the following command line in Pycaffe?

build/tools/caffe train \
-solver models/finetune_flickr_style/solver.prototxt \
-weights models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel 

Upvotes: 1

Views: 3890

Answers (1)

cerebrou
cerebrou

Reputation: 5540

Loading caffemodel for finetuning with a particular solver can be obtained in Pycaffe by means of get_solver() and net.copy_from() functions:

solver=caffe.get_solver('prototxtfile.prototxt')
solver.net.copy_from('weights.caffemodel')

Upvotes: 5

Related Questions