Skip to content

Trainer should run the test loop with the best weights when ModelCheckpoint is used #2046

@yukw777

Description

@yukw777

🚀 Feature

Motivation

I noticed that even when ModelCheckpoint is used, Trainer by default runs the test loop with the last weights, not the best weights saved by ModelCheckpoint. I believe the sensible default here is to run the test loop with the best weights saved by ModelCheckpoint.

Pitch

Now that ModelCheckpoint has a pointer to the best weights, Trainer can replace the last weights with the best weights before running the test loop automatically.

Alternatives

Possibly, this could be another option to Trainer. I don't like this as much b/c this is the behavior most users would expect.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIs an improvement or enhancementhelp wantedOpen to be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions