Skip to content

Setting ckpt_path='last' in Trainer.fit does not work with cloud checkpoints #18261

Description

Bug description

Setting ckpt_path='last' in Trainer.fit will not work with cloud checkpoints (GCS, S3). This is because the current logic for finding checkpoint paths calls os.path.normpath which drops the gs:// and s3:// path prefixes for cloud paths, causing them to be treated as local paths later on.

https://github.com/Lightning-AI/lightning/blob/8f81dafd9512af8b4e42eeb30badc604883a92c4/src/lightning/pytorch/callbacks/model_checkpoint.py#L611-L620

What version are you seeing the problem on?

master

How to reproduce the bug

No response

Error messages and logs

# Error messages and logs here please

Environment

Current environment
#- Lightning Component (e.g. Trainer, LightningModule, LightningApp, LightningWork, LightningFlow):
#- PyTorch Lightning Version (e.g., 1.5.0):
#- Lightning App Version (e.g., 0.5.2):
#- PyTorch Version (e.g., 2.0):
#- Python version (e.g., 3.9):
#- OS (e.g., Linux):
#- CUDA/cuDNN version:
#- GPU models and configuration:
#- How you installed Lightning(`conda`, `pip`, source):
#- Running environment of LightningApp (e.g. local, cloud):

More info

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds triageWaiting to be triaged by maintainersver: 2.1.x

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions