Skip to content
Edit on GitHub

How it Works

DVCLive will store the logged data under the directory (dir) passed to Live(). If not provided, dvclive will be used by default.

The contents of the directory will depend on the methods used:

MethodWrites to
live.log_metricdvclive/plots/metrics
live.log_imagedvclive/plots/images
live.log_paramdvclive/params.yaml
live.log_sklearn_plotdvclive/plots/sklearn
live.make_reportdvclive/report.{md/html}
live.make_summarydvclive/metrics.json

live.next_step() takes care of calling live.make_report() and live.make_summary, in addition to increasing the step number.

Example

To illustrate with an example, given the following script:

import random

from dvclive import Live
from PIL import Image

EPOCHS = 2

with Live() as live:
    live.log_param("epochs", EPOCHS)

    for i in range(EPOCHS):
        live.log_metric("metric", i + random.random())
        live.log_metric("nested/metric", i + random.random())
        live.log_image("img.png", Image.new("RGB", (50, 50), (i, i, i)))
        live.next_step()

    live.log_sklearn_plot("confusion_matrix", [0, 0, 1, 1], [0, 1, 0, 1])
    live.summary["additional_metric"] = 1.0

The resulting structure will be:

dvclive
├── metrics.json
├── params.yaml
├── plots
│   ├── images
│   │   └── img.png
│   ├── metrics
│   │   ├── metric.tsv
│   │   └── nested
│   │       └── metric.tsv
│   └── sklearn
│       └── confusion_matrix.json
└── report.html
Content

🐛 Found an issue? Let us know! Or fix it:

Edit on GitHub

Have a question? Join our chat, we will help you:

Discord Chat