Skip to content

Why all files are deleted from model checkpoint directory when save_top_k=1? #5173

@celsofranssa

Description

@celsofranssa
checkpoint_callback = ModelCheckpoint(
        monitor="val_loss",
        dirpath=hparams.model_checkpoint.dir,
        filename=hparams.model.name+"_"+hparams.data.name+"_{epoch:02d}",
        save_top_k=1,
        mode="min"
    )
#UserWarning: Checkpoint directory With save_top_k=1, all files in this directory will be deleted when a checkpoint is saved!

Shouldn't it delete only the latest checkpoints of the same name?
Or should I have a directory for each model I train?

Metadata

Metadata

Assignees

No one assigned

    Labels

    checkpointingRelated to checkpointingfeatureIs an improvement or enhancementquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions