-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Why is snapshot
not exposed through the Python interface?
#3077
Comments
See Fast R-CNN (https://github.com/rbgirshick/fast-rcnn/blob/master/lib/fast_rcnn/train.py#L48) as an example of performing a snapshot in Python. This example has extra re-scaling of weights, but essentially you just call net.save(). |
Calling |
Personally I think it is better to expose Snapshot function to pycaffe. I can write a PR for that when less busy. |
I agree. I can also arrange a PR, since I have already made these changes locally. |
- Solver::Snapshot is made public - It is also added as `snapshot` to pycaffe Addressing BVLC#3077
Closing as addressed by #3082. |
- Solver::Snapshot is made public - It is also added as `snapshot` to pycaffe Addressing BVLC#3077
- Solver::Snapshot is made public - It is also added as `snapshot` to pycaffe Addressing BVLC#3077
I have written a Python script to manage my training and I'm adding a signal interrupt handler that upon receiving
SIGTERM
will finish its current iteration and then snapshot and safely quit.However, I noticed that
Solver::Snapshot
isprotected
and thus not exposed to Python. I don't understand why this is the case, since my use case seems perfectly reasonable. Changing this locally and addingsnapshot
topython/_caffe.cpp
has worked out well for me so far.A way around it might be to somehow change the snapshot parameter through Python and that way force a snapshot to be made at the next iteration. I don't even know if this is possible, but even it is it's quite an ugly hack compared to just calling
snapshot()
. It would also delay the snapshot by one iteration.The text was updated successfully, but these errors were encountered: