vak.config.trainer.TrainerConfig¶
- class vak.config.trainer.TrainerConfig(accelerator: str = 'cpu', devices: int | list[int] | None = None)[source]¶
Bases:
object
Class that represents
trainer
sub-table in a toml configuration file.Used to configure
lightning.pytorch.Trainer
.- accelerator¶
Value for the accelerator argument to
lightning.pytorch.Trainer
. Default is the return value ofvak.common.accelerator.get_default()
.- Type:
Notes
Using the ‘auto’ value for the lightning.pytorch.Trainer parameter accelerator currently breaks functionality for the command-line interface of vak. Please see this issue: https://github.com/vocalpy/vak/issues/691 If you need to use the ‘auto’ mode of lightning.pytorch.Trainer, please use vak directly in a script.
Likewise, setting a value for the lightning.pytorch.Trainer parameter devices that is not either 1 (meaning “use a single GPU”) or a list with a single number (meaning “use this exact GPU”) currently breaks functionality for the command-line interface of vak. Please see this issue: https://github.com/vocalpy/vak/issues/691 If you need to use multiple GPUs, please use vak directly in a script.
- __init__(accelerator: str = 'cpu', devices: int | list[int] | None = None) None ¶
Method generated by attrs for class TrainerConfig.
Methods
__init__
([accelerator, devices])Method generated by attrs for class TrainerConfig.
asdict
()Convert this
TrainerConfig
instance to adict
that can be passed into functions that take atrainer_config
argument, likevak.train()
andvak.predict()
.Attributes
- asdict()[source]¶
Convert this
TrainerConfig
instance to adict
that can be passed into functions that take atrainer_config
argument, likevak.train()
andvak.predict()
.