Shortcuts

SaveConfigCallback

class lightning.pytorch.cli.SaveConfigCallback(parser, config, config_filename='config.yaml', overwrite=False, multifile=False)[소스]

기반 클래스: lightning.pytorch.callbacks.callback.Callback

Saves a LightningCLI config to the log_dir when training starts.

매개변수
  • parser (LightningArgumentParser) – The parser object used to parse the configuration.

  • config (object) – The parsed configuration that will be saved.

  • config_filename (str) – Filename for the config file.

  • overwrite (bool) – Whether to overwrite an existing config file.

  • multifile (bool) – When input is multiple config files, saved config preserves this structure.

예외 발생

RuntimeError – If the config file already exists in the directory to avoid overwriting a previous run

setup(trainer, pl_module, stage)[소스]

Called when fit, validate, test, predict, or tune begins.

반환 형식

None