rslearn.train.callbacks.checkpointing¶
checkpointing ¶
Checkpoint callbacks for rslearn.
BestLastCheckpoint ¶
Bases: Callback
Saves both last.ckpt (every validation) and best.ckpt (when metric improves).
Source code in rslearn/train/callbacks/checkpointing.py
state_dict ¶
load_state_dict ¶
on_validation_end ¶
Save last.ckpt always, and best.ckpt when the monitored metric improves.
Source code in rslearn/train/callbacks/checkpointing.py
ManagedBestLastCheckpoint ¶
Bases: BestLastCheckpoint
BestLastCheckpoint that resolves dirpath from trainer.default_root_dir.
Use with project management: the CLI sets trainer.default_root_dir to the project directory ({MANAGEMENT_DIR}/{PROJECT_NAME}/{RUN_NAME}), and this callback picks it up at setup time.
Source code in rslearn/train/callbacks/checkpointing.py
setup ¶
Resolve dirpath from trainer.default_root_dir.