Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TODO]: use best model in notebooks #820

Open
KnathanM opened this issue Apr 19, 2024 · 0 comments
Open

[TODO]: use best model in notebooks #820

KnathanM opened this issue Apr 19, 2024 · 0 comments
Labels
todo add an item to the to-do list
Milestone

Comments

@KnathanM
Copy link
Contributor

KnathanM commented Apr 19, 2024

Our example notebooks use trainer.test(mpnn, test_loader). We may want to show users how to test on their best model. They would do this by making a checkpointing callback and passing that to the trainer:

from lightning.pytorch.callbacks import ModelCheckpoint
checkpointing = ModelCheckpoint(
           "tempdir",
            "best-{epoch}-{val_loss:.2f}",
            "val_loss",
            mode="min",
            save_last=True,
        )
trainer = pl.Trainer(callbacks=[checkpointing])

Then they don't give the trainer a model: trainer.test(dataloaders=test_loader).
We can do this as part of the documentation after v2.0 is out on pypi.

@KnathanM KnathanM added the todo add an item to the to-do list label Apr 19, 2024
@KnathanM KnathanM added this to the v2.1.0 milestone Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
todo add an item to the to-do list
Projects
None yet
Development

No branches or pull requests

1 participant