construct_trainer#

construct_trainer(
cfg,
wandb_logger,
run_name,
experiment_dir=None,
num_nodes=1,
)#

Construct a trainer and the checkpoint callback from a configuration.

Parameters:
  • cfg (ExperimentConfig) – The configuration.

  • wandb_logger (pl.loggers.WandbLogger) – The wandb logger.

  • run_name (str) – The run name, used only if experiment_dir is not provided.

  • experiment_dir (Optional[Path]) – The experiment directory. If not provided, the run name is used to create the checkpoint directory.

  • num_nodes (int) – The number of nodes to use for training.

Returns:

The constructed trainer and the checkpoint callback.

Return type:

tuple[pl.Trainer, pl.Callback]