bob.med.tb.utils.checkpointer¶
Classes
|
A simple pytorch checkpointer |
- class bob.med.tb.utils.checkpointer.Checkpointer(model, optimizer=None, scheduler=None, path='.')[source]¶
Bases:
object
A simple pytorch checkpointer
- Parameters
model (torch.nn.Module) – Network model, eventually loaded from a checkpointed file
optimizer (
torch.optim
, Optional) – Optimizerscheduler (
torch.optim
, Optional) – Learning rate schedulerpath (
str
, Optional) – Directory where to save checkpoints.
- load(f=None, strict=True)[source]¶
Loads model, optimizer and scheduler from file
- Parameters
f (
str
, Optional) – Name of a file (absolute or relative toself.path
), that contains the checkpoint data to load into the model, and optionally into the optimizer and the scheduler. If not specified, loads data from current path.partial (
bool
, Optional) – If True, loading is not strict and only the model is loaded