TrackioLogger

class lightning.pytorch.loggers.TrackioLogger(project, name=None, resume='allow', **kwargs)[source]

Bases: Logger

Log metrics and hyperparameters to Trackio.

Parameters:
  • project (str) – The name of the project to which the experiment belongs.

  • name (Optional[str]) – The name of the run. If not provided, it defaults to the project name

  • resume (Literal['never', 'allow', 'must']) – Resume behavior, one of ‘never’, ‘allow’, or ‘must’. Defaults to ‘allow’.

  • **kwargs (Any) – Additional keyword arguments passed to trackio.init().

Raises:

ModuleNotFoundError – If trackio is not installed.

Example

from lightning.pytorch.loggers import TrackioLogger
from lightning.pytorch import Trainer

trackio_logger = TrackioLogger(
    project="my_project",
    name="my_experiment",
)
trainer = Trainer(max_epochs=10, logger=trackio_logger)
finalize(status)[source]

Do any processing that is necessary to finalize an experiment.

Parameters:

status (str) – Status that the experiment finished with (e.g. success, failed, aborted)

Return type:

None

log_hyperparams(params, *args, **kwargs)[source]

Record hyperparameters.

Parameters:
  • params (Union[dict[str, Any], Namespace]) – Namespace or Dict containing the hyperparameters

  • args (Any) – Optional positional arguments, depends on the specific logger being used

  • kwargs (Any) – Optional keyword arguments, depends on the specific logger being used

Return type:

None

log_metrics(metrics, step=None)[source]

Records metrics. This method logs metrics as soon as it received them.

Parameters:
  • metrics (dict[str, float]) – Dictionary with metric names as keys and measured quantities as values

  • step (Optional[int]) – Step number at which the metrics should be recorded

Return type:

None

property name: str

Return the experiment name.

property version: Optional[Union[int, str]]

Return the experiment version.