1757 Enhance CheckpointLoader to restore max_epochs#1775
1757 Enhance CheckpointLoader to restore max_epochs#1775ericspod merged 11 commits intoProject-MONAI:masterfrom
Conversation
|
/black |
|
@vfdev-5 , could you please help review this PR? Thanks in advance. |
|
/black |
|
The current error message is ambiguous and does not really help the user debug without a dive in the MONAI codebase. I would change the error message to be more descriptive from: to It might be too stuffy, please have a go at trimming it down if you feel it needs it. |
A little more concise: ValueError(f"Epoch count in checkpoint ({engine.state.epoch}) is larger than the `engine.state.max_epochs` of engine ({prior_max_epochs}). To further train from checkpoint construct trainer with `max_epochs` larger than checkpoint's epoch count. To use for inference `max_epochs` must be the same as checkpoint.") |
|
Hi @ericspod , I updated the PR for the error message, slightly modified the inference part. Thanks. |
|
/black |
Signed-off-by: Nic Ma <[email protected]>
Signed-off-by: Nic Ma <[email protected]>
|
/black |
Fixes #1757 .
Description
This PR fixed the issue that if loading the state_dict of engine itself, it will overwrite current
max_epochsvalue.Status
Ready
Types of changes
./runtests.sh -f -u --net --coverage../runtests.sh --quick --unittests.make htmlcommand in thedocs/folder.