Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • M metaseq
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 95
    • Issues 95
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 41
    • Merge requests 41
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Administrator
  • metaseq
  • Issues
  • #279
Closed
Open
Issue created Aug 01, 2022 by Administrator@rootOwner

Have trainer.load_checkpoint accept NoneType checkpoint path string

Created by: KUNAL1612

🚀 Feature Request

In checkpoint_utils.py, in line 312, if checkpoint_path_to_load needs to be a valid string and can't be None. However if the string points to an invalid file, then extra state is None. In line with the work done in #158 (which has now been rolled back but presumably will be reinstated at some point), it is sometimes possible that the checkpoint file is invalid/incorrect so we might manually want to pass None as the checkpoint_path_to_load.

The exact error when passing a NoneType object is:

TypeError: expected str, bytes or os.PathLike object, not NoneType

Pitch

One of two things can be done to address this

  • ensure that the filename can be None in trainer.load_checkpoint (L405)
  • in checkpoint_utils.load_checkpoint, if the checkpoint_path_load is None, skip the logic to generate extra_state and just manually set that to None, so that training can begin from scratch

Importance

While if no checkpoint is passed, the checkpoint_path_load string is a default filename, this does not make much sense and I think in general it would make more sense if this were None for when the checkpoint did not exist, or existed and was corrupted.

Assignee
Assign to
Time tracking