I am buliding my project with LightningCLI, and I want to use multiple loggers (TensorBoardLogger and WandbLogger), and I ran into some problems:
1.If I provide only one logger through command line, everything works fine
# no problem
python main.py fit --trainer.logger+=TensorBoardLogger
# no problem
python main.py fit --trainer.logger+=WandbLogger --trainer.logger.name=FromCLI
- If I provide two loggers, I get an error
python main.py fit --trainer.logger+=TensorBoardLogger --trainer.logger+=WandbLogger --trainer.logger.name=FromCLI
here’s what i got:
- If I write them in an YAML file, then the command line won’t work
my YAML file for example:
trainer:
logger:
- class_path: pytorch_lightning.loggers.TensorBoardLogger
- class_path: pytorch_lightning.loggers.WandbLogger
init_args:
name: FromYAML
and here’s my command:
python main.py fit --config config.yaml --trainer.logger+=WandbLogger --trainer.logger.name=FromCLI
And the logger file’s name will be “FromYAML”, though I gave “FromCLI” in the command. But the TensorBoardLogger was successfully instantiated and worked, which means LightningCLI is able to handle multiple loggers, I wonder how can I provide multiple loggers by command line?