Is it possible to pass arguments to callbacks in the LightningCLI? #14339
Answered
by
mauvilsa
cgoliver
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
-
For example, if I wanted to set the option for |
Beta Was this translation helpful? Give feedback.
Answered by
mauvilsa
Aug 22, 2022
Replies: 1 comment
-
The syntax is described in https://pytorch-lightning.readthedocs.io/en/stable/cli/lightning_cli_advanced_3.html#trainer-callbacks-and-arguments-with-class-type. As command line arguments would be: $ python ... \
--trainer.callbacks+=BasePredictionWriter \
--trainer.callbacks.write_interval=batch \
... Or in a config file: trainer:
callbacks:
- class_path: BasePredictionWriter
init_args:
write_interval: batch |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
cgoliver
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The syntax is described in https://pytorch-lightning.readthedocs.io/en/stable/cli/lightning_cli_advanced_3.html#trainer-callbacks-and-arguments-with-class-type. As command line arguments would be:
Or in a config file: