Documentation
Search…
Explore and traverse artifact graphs
Weights & Biases automatically tracks the artifacts a given run logged as well as the artifacts a given run used. The graph view shows a general overview of your pipeline.
To view an artifact graph:
  1. 1.
    Navigate to your project in the W&B App UI
  2. 2.
    Choose the artifact icon on the left panel.
  3. 3.
    Select Lineage.
The type you provide when you create runs and artifacts are used to create the graph. The input and output of a run or artifact is depicted in the graph with arrows.
Artifacts are represented by blue rectangles and Runs are represented by green rectangles. The artifact type you provided is located in the dark blue header next to the ARTIFACT label. The name of the artifact, along with the artifact version, is shown in the light blue region underneath the ARTIFACT label.
The job type you provided when you initialized a run is located next to the RUN label. The W&B run name is located in the light green region underneath the RUN label.
DAG view of artifacts, runs used for an experiment.
For example, in the preceding image, the first artifact in the graph was given a 'dataset' type when the artifact was created. The name of the artifact is 'coco-train'.
A W&B run was initialized (wandb.init) with a job type called 'model_trainer'. The original dataset version, 'coco-train:v0', was used in the W&B Run called 'vivid-sunset-5'.
For a more detailed view, select the Explode toggle on the upper left hand side of the dashboard. The expanded graph shows details of every run and every artifact in the project that was logged. Above the circle or square is a key-value pair. The key is the type, and the value is either the run name (runs) or the version (artifacts).
Try it yourself on this example Graph page.

Traverse a graph

Programmatically walk a graph with the W&B Public API (wandb.Api). Traverse a graph from an artifact or from a run.

Traverse from an artifact

Create an artifact object with the W&B Public API (wandb.Api). Provide the name of the project, artifact and alias of the artifact:
import wandb
api = wandb.Api()
artifact = api.artifact('project/artifact:alias')
Use the artifact objects logged_by and used_by methods to walk the graph from the artifact:
# Walk up and down the graph from an artifact:
producer_run = artifact.logged_by()
consumer_runs = artifact.used_by()

Traverse from a run

Create an artifact object with the W&B Public API (wandb.Api.Run). Provide the name of the entity, project, and run ID:
import wandb
api = wandb.Api()
artifact = api.run('entity/project/run_id')
Use the logged_artifacts and used_artifacts methods to walk the graph from a given run:
# Walk up and down the graph from a run:
logged_artifacts = run.logged_artifacts()
used_artifacts = run.used_artifacts()
Copy link
Outline
Traverse a graph