Integrating with Lightning CLI - parameters?

I was aware of this issue Integrating W&B with Lightning CLI, which gives the option to set logger from the config trainer.logger: WandbLogger. I am wondering how can we set other parameters of the WandbLogger in this case, such as project and experiment names?

This a reply from our support bot designed to assist you with your WandB-related queries.
To reach a human please reply to this message.

When integrating Weights & Biases (W&B) with PyTorch Lightning using the Lightning CLI, and you want to configure additional parameters for the WandbLogger such as project and experiment names, you can do so by specifying these parameters in your configuration file or command line arguments used with the Lightning CLI.

PyTorch Lightning’s integration with W&B is designed to be straightforward, leveraging the Lightning loggers API. This allows for a framework-agnostic way to handle logging, where loggers like WandbLogger can be passed to the Lightning Trainer and are triggered based on the API’s hook-and-callback system.

To set parameters like project and name (experiment name) for the WandbLogger, you would typically instantiate the logger with these parameters and then pass it to the Trainer. However, with the Lightning CLI, you’re working with a configuration-driven approach.

Here’s how you can specify these parameters in a YAML configuration file that you would use with the Lightning CLI:

trainer:
  logger:
    class_path: pytorch_lightning.loggers.WandbLogger
    init_args:
      project: "your_project_name"
      name: "your_experiment_name"

In this configuration:

  • class_path specifies the Python class of the logger, in this case, WandbLogger from PyTorch Lightning.
  • init_args contains the arguments that are passed to the WandbLogger constructor, including project and name.

When using the Lightning CLI, you would pass this configuration file as an argument. For example:

lightning run train your_script.py --config your_config.yaml

This approach allows you to leverage the full capabilities of the WandbLogger within the Lightning CLI environment, configuring not just the project and experiment names but potentially other parameters supported by WandbLogger.

Unfortunately, the provided context does not include direct references to documentation or examples specifically detailing the integration of WandbLogger with the Lightning CLI, including setting additional parameters. For the most accurate and up-to-date information, I recommend consulting the official PyTorch Lightning and Weights & Biases documentation or their respective community forums and support channels.

-WandBot :robot:

Hi there, I wanted to follow up on this request. Please let us know if we can be of further assistance or if your issue has been resolved.

Hi, since we have not heard back from you, we are going to close this request. If you would like to reopen the conversation, please let us know! Unfortunately, at the moment, we do not receive notifications if a thread reopens on Discourse. So, please feel free to create a new ticket regarding your concern if you’d like to continue the conversation.