Skip to content

Why is snapshot not exposed through the Python interface? #3077

@gustavla

Description

@gustavla

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 is protected 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 adding snapshot to python/_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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions