Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to initialize a network using .caffemodel, .solverstate? Thank you. #5730

Closed
ayeshasGithub opened this issue Jun 30, 2017 · 6 comments
Closed

Comments

@ayeshasGithub
Copy link

Could any please show me how to initialize a deep network using .caffemodel or .solverstate?

Thanks
Ayesha

@amalF
Copy link

amalF commented Jul 6, 2017

Hello @ayeshasGithub

To resume from a snapshot :
caffe train -gpu all -solver my_model/solver.prototxt -snapshot my_model/my_model_iter_6000.solverstate 2>&1 | tee log/my_model.log

To use weights of a trained model

caffe train -gpu all -solver my_model/solver.prototxt -weights my_model/bvlc_reference_caffenet.caffemodel 2>&1 | tee -a log/my_model.log

Hope it helps
cheers

@ayeshasGithub
Copy link
Author

Thanks so much amal, but I need those commands in python. Do you know how I can do it in python?

@amalF
Copy link

amalF commented Jul 7, 2017

In your train.py, you can use solver.net.copy_from(pretrained_model) to restore a trained model and solver.restore(previous_state) to restore previous solver state.

You can find an example here : https://github.com/rbgirshick/py-faster-rcnn/blob/master/lib/fast_rcnn/train.py

Hope it helps
Cheers

@ayeshasGithub
Copy link
Author

Nice of you amal, thank you so much, that definitely should help, thanks a lot

@pratikds
Copy link

Hello,

Do I need to keep the same old learning rate in solver file while resuming the training via snapshot or I need to change the base_lr where it had left of?

Cheers

@shaibagon
Copy link
Member

Please use the caffe-users list for usage, installation, or modeling questions, or other requests for help.
You may also post questions on stackoverflow, make sure you tag them with caffe tag.
There is also caffe.help documenting the different layers of caffe.
Do not post such requests to Issues. Doing so interferes with the development of Caffe.

Please read the guidelines for contributing before submitting this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants