LightningIRWandbLogger
- class lightning_ir.main.LightningIRWandbLogger(name: str | None = None, save_dir: str | Path = '.', version: str | None = None, offline: bool = False, dir: str | Path | None = None, id: str | None = None, anonymous: bool | None = None, project: str | None = None, log_model: 'all' | bool = False, experiment: Run | RunDisabled | None = None, prefix: str = '', checkpoint_name: str | None = None, **kwargs: Any)[source]
Bases:
WandbLogger
- __init__(name: str | None = None, save_dir: str | Path = '.', version: str | None = None, offline: bool = False, dir: str | Path | None = None, id: str | None = None, anonymous: bool | None = None, project: str | None = None, log_model: 'all' | bool = False, experiment: Run | RunDisabled | None = None, prefix: str = '', checkpoint_name: str | None = None, **kwargs: Any) None
Methods
__init__
([name, save_dir, version, offline, ...])after_save_checkpoint
(checkpoint_callback)download_artifact
(artifact[, save_dir, ...])Downloads an artifact from the wandb server.
finalize
(status)log_audio
(key, audios[, step])Log audios (numpy arrays, or file paths).
log_graph
(model[, input_array])Record model graph.
log_hyperparams
(params)log_image
(key, images[, step])Log images (tensors, numpy arrays, PIL Images or file paths).
log_metrics
(metrics[, step])log_table
(key[, columns, data, dataframe, step])Log a Table containing any object type (text, image, audio, video, molecule, html, etc).
log_text
(key[, columns, data, dataframe, step])Log text as a Table.
log_video
(key, videos[, step])Log videos (numpy arrays, or file paths).
save
()Save log data.
use_artifact
(artifact[, artifact_type])Logs to the wandb dashboard that the mentioned artifact is used by the run.
watch
(model[, log, log_freq, log_graph])Attributes
LOGGER_JOIN_CHAR
Actual wandb object.
Return the default separator used by the logger to group the data into subfolders.
Return directory the current version of the experiment gets saved, or None if the logger does not save data locally.
The project name of this experiment.
Return the root directory where all versions of an experiment get saved, or None if the logger does not save data locally.
Gets the save directory.
Gets the id of the experiment.
- static download_artifact(artifact: str, save_dir: str | Path | None = None, artifact_type: str | None = None, use_artifact: bool | None = True) str
Downloads an artifact from the wandb server.
- Parameters:
artifact – The path of the artifact to download.
save_dir – The directory to save the artifact to.
artifact_type – The type of artifact to download.
use_artifact – Whether to add an edge between the artifact graph.
- Returns:
The path to the downloaded artifact.
- property experiment: Run | RunDisabled
Actual wandb object. To use wandb features in your
LightningModule
do the following.Example:
.. code-block:: python
self.logger.experiment.some_wandb_function()
- property group_separator: str
Return the default separator used by the logger to group the data into subfolders.
- log_audio(key: str, audios: list[Any], step: int | None = None, **kwargs: Any) None
Log audios (numpy arrays, or file paths).
- Parameters:
key – The key to be used for logging the audio files
audios – The list of audio file paths, or numpy arrays to be logged
step – The step number to be used for logging the audio files
**kwargs – Optional kwargs are lists passed to each
Wandb.Audio
instance (ex: caption, sample_rate).
Optional kwargs are lists passed to each audio (ex: caption, sample_rate).
- property log_dir: str | None
Return directory the current version of the experiment gets saved, or None if the logger does not save data locally.
- log_graph(model: Module, input_array: Tensor | None = None) None
Record model graph.
- Parameters:
model – the model with an implementation of
forward
.input_array – input passes to model.forward
- log_image(key: str, images: list[Any], step: int | None = None, **kwargs: Any) None
Log images (tensors, numpy arrays, PIL Images or file paths).
Optional kwargs are lists passed to each image (ex: caption, masks, boxes).
- log_table(key: str, columns: list[str] | None = None, data: list[list[Any]] | None = None, dataframe: Any = None, step: int | None = None) None
Log a Table containing any object type (text, image, audio, video, molecule, html, etc).
Can be defined either with columns and data or with dataframe.
- log_text(key: str, columns: list[str] | None = None, data: list[list[str]] | None = None, dataframe: Any = None, step: int | None = None) None
Log text as a Table.
Can be defined either with columns and data or with dataframe.
- log_video(key: str, videos: list[Any], step: int | None = None, **kwargs: Any) None
Log videos (numpy arrays, or file paths).
- Parameters:
key – The key to be used for logging the video files
videos – The list of video file paths, or numpy arrays to be logged
step – The step number to be used for logging the video files
**kwargs – Optional kwargs are lists passed to each Wandb.Video instance (ex: caption, fps, format).
Optional kwargs are lists passed to each video (ex: caption, fps, format).
- property name: str | None
The project name of this experiment.
- Returns:
The name of the project the current experiment belongs to. This name is not the same as wandb.Run’s name. To access wandb’s internal experiment name, use
logger.experiment.name
instead.
- property root_dir: str | None
Return the root directory where all versions of an experiment get saved, or None if the logger does not save data locally.