-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
How can I perform only validation without training #2481
Comments
The progress bar averages the values over time. model = ...
trainer = Trainer(...)
trainer.test(model, ckpt_path="path/to/m10-f1_1=0.8737.ckpt", test_dataloaders=model.val_dataloader()) |
I'm afraid not. This code does not call validation_ step() and validation_ epoch_ end() and it can not calc the metric either |
You need to implement test_step and test_epoch end. If testing does not differ from your validation, you can just call validstion_step from test_step. |
@awaelchli What if they(testing and validation procedures) are different or don't have any |
I think we need to wait for #2107 for this to be possible. evaluate() would have to be different from the validation loop that runs during training, for example, it should not invoke callbacks like early stopping or checkpointing. |
I thought its not allowed? I remember seeing it here |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
what about this: "You can also run just the validation loop on your validation dataloaders by overriding validation_step() and calling validate()."
from https://pytorch-lightning.readthedocs.io/en/latest/common/lightning_module.html ; validation loop. Also there: "Validation You can perform an evaluation epoch over the validation set, outside of the training loop, using pytorch_lightning.trainer.trainer.Trainer.validate(). This might be useful if you want to collect new metrics from a model right at its initialization or after it has already been trained."
https://pytorch-lightning.readthedocs.io/en/stable/common/trainer.html#validation |
Yep! Nice find @Code-Cornelius. Since the original posting of this issue, we introduced Trainer.validate. |
❓ Questions and Help
It seems the metric 0.8737 in the checkpoint 'm10-f1_1=0.8737.ckpt' can not be found in progress_bar,
I want to load the .ckpt to perform validation without training,
How should I config the trainer?
The text was updated successfully, but these errors were encountered: