Skip to content

MisconfigurationException use cases #20553

@moghadas76

Description

@moghadas76

Outline & Motivation

if (
            self.trainer.max_epochs != -1
            and self.trainer.max_epochs is not None
            and self.trainer.current_epoch > self.trainer.max_epochs
        ):
            raise MisconfigurationException(
                f"You restored a checkpoint with current_epoch={self.trainer.current_epoch},"
                f" but you have set Trainer(max_epochs={self.trainer.max_epochs})."
            )```

### Pitch

if (
self.trainer.max_epochs != -1
and self.trainer.max_epochs is not None
and self.trainer.current_epoch > self.trainer.max_epochs
):
return None


### Additional context

_No response_

cc @lantiga @justusschock

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions