Skip to content

the example that shows "The LightningModule also has access to the Hyperparameters" is not correct #20303

@XinleiRen

Description

@XinleiRen

📚 Documentation

On the page https://lightning.ai/docs/pytorch/stable/common/checkpointing_basic.html, the example that shows "The LightningModule also has access to the Hyperparameters" is not correct, the example is as follow:

model = MyLightningModule.load_from_checkpoint("/path/to/checkpoint.ckpt")
print(model.learning_rate)

it should be:

model = MyLightningModule.load_from_checkpoint("/path/to/checkpoint.ckpt")
print(model.hparams["learning_rate"])

cc @Borda

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation relatedneeds triageWaiting to be triaged by maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions