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: Literal['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: Literal['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

experiment

Actual wandb object.

group_separator

Return the default separator used by the logger to group the data into subfolders.

log_dir

Return directory the current version of the experiment gets saved, or None if the logger does not save data locally.

name

The project name of this experiment.

root_dir

Return the root directory where all versions of an experiment get saved, or None if the logger does not save data locally.

save_dir

Gets the save directory.

version

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.

save() None

Save log data.

property save_dir: str | None

Gets the save directory.

Returns:

The path to the save directory.

use_artifact(artifact: str, artifact_type: str | None = None) Artifact

Logs to the wandb dashboard that the mentioned artifact is used by the run.

Parameters:
  • artifact – The path of the artifact.

  • artifact_type – The type of artifact being used.

Returns:

wandb Artifact object for the artifact.

property version: str | None

Gets the id of the experiment.

Returns:

The id of the experiment if the experiment exists else the id given to the constructor.