saving the best model along with the optimizer state and parameter schedulers typically involves configuring the training pipeline and checkpointing mechanisms.
suppose this is your sample training script which saves the best optimizer state and scheduler.
this is how you will save your checkpoint using different utilities of any openmmlab's toolkit.
from mmcv.runner import save_checkpoint
from mmseg.models import build_segmentor
from mmseg.datasets import build_dataset
from mmseg.apis import init_segmentor
checkpoint_path = 'path/to/your/manual_checkpoint.pth'
save_checkpoint(
model,
checkpoint_path,
optimizer=model.optimizer,
meta={'epoch': 10, 'iter': 1000} # Example meta information
)
saving the best model along with the optimizer state and parameter schedulers typically involves configuring the training pipeline and checkpointing mechanisms.
suppose this is your sample training script which saves the best optimizer state and scheduler.
this is how you will save your checkpoint using different utilities of any openmmlab's toolkit.