Skip to content

Lightning v2.6.0: S3LightningCheckpoint.load_checkpoint() missing 'weights_only' parameter #387

@jet-tong

Description

@jet-tong

s3torchconnector version

s3torchconnector-1.4.3

s3torchconnectorclient version

s3torchconnectorclient-1.4.3

AWS Region

No response

Describe the running environment

Across all environments (CI Github Runners).

What happened?

Lightning-AI/pytorch-lightning#21072 change causes TypeError: S3LightningCheckpoint.load_checkpoint() got an unexpected keyword argument 'weights_only'.

This is due to lacking weights_only parameter in S3LightningCheckpoint.load_checkpoint().

Relevant log output

def load_checkpoint(self, checkpoint_path: _PATH, weights_only: Optional[bool] = None) -> dict[str, Any]:
        torch.cuda.empty_cache()
>       return self.checkpoint_io.load_checkpoint(checkpoint_path, weights_only=weights_only)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       TypeError: S3LightningCheckpoint.load_checkpoint() got an unexpected keyword argument 'weights_only'

/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/lightning/pytorch/strategies/strategy.py:368: TypeError

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions