WandBLogger¶
- class torchtune.utils.metric_logging.WandBLogger(project: str, entity: Optional[str] = None, group: Optional[str] = None, **kwargs)[source]¶
Logger for use w/ Weights and Biases application (https://wandb.ai/). For more information about arguments expected by WandB, see https://docs.wandb.ai/ref/python/init.
- Parameters:
Example
>>> from torchtune.utils.metric_logging import WandBLogger >>> logger = WandBLogger(project="my_project", entity="my_entity", group="my_group") >>> logger.log("my_metric", 1.0, 1) >>> logger.log_dict({"my_metric": 1.0}, 1) >>> logger.close()
- Raises:
ImportError – If
wandb
package is not installed.
Note
This logger requires the wandb package to be installed. You can install it with pip install wandb. In order to use the logger, you need to login to your WandB account. You can do this by running wandb login in your terminal.
- close() None [source]¶
Close log resource, flushing if necessary. Logs should not be written after close is called.