> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wandb.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# run がログした、または使用した artifact を検索するにはどうすればよいですか？ artifact を生成または使用した Runs を検索するにはどうすればよいですか？

このページでは、W\&B で runs と artifacts の関係をたどる方法を説明します。特定の artifact を生成または使用した run や、特定の run が生成または使用した artifacts を検索できます。これは、データ リネージの監査、パイプラインのデバッグ、artifacts が Experiments 全体でどのように流れるかを把握するのに役立ちます。

W\&B は、各 run がログする artifact と使用する artifact をトラッキングして artifact グラフを構築します。このグラフは、runs と artifacts を表すノードを持つ二部有向非巡回グラフです。[artifact グラフの例](https://wandb.ai/shawn/detectron2-11/artifacts/dataset/furniture-small-val/06d5ddd4deeb2a6ebdd5/graph)を参照し、**Explode** をクリックしてグラフを展開してください。

W\&B Public API を使用すると、artifact または run のいずれかを起点として、プログラムからグラフをたどることができます。開始地点に合ったタブを選択してください。

<Tabs>
  <Tab title="artifact から">
    ```python theme={null}
    api = wandb.Api()

    artifact = api.artifact("[PROJECT]/[ARTIFACT]:[ALIAS]")

    # artifact からグラフを上方向にたどります:
    producer_run = artifact.logged_by()
    # artifact からグラフを下方向にたどります:
    consumer_runs = artifact.used_by()

    # run からグラフを下方向にたどります:
    next_artifacts = consumer_runs[0].logged_artifacts()
    # run からグラフを上方向にたどります:
    previous_artifacts = producer_run.used_artifacts()
    ```
  </Tab>

  <Tab title="run から">
    ```python theme={null}
    api = wandb.Api()

    run = api.run("[ENTITY]/[PROJECT]/[RUN_ID]")

    # run からグラフを下方向にたどります:
    produced_artifacts = run.logged_artifacts()
    # run からグラフを上方向にたどります:
    consumed_artifacts = run.used_artifacts()

    # artifact からグラフを上方向にたどります:
    earlier_run = consumed_artifacts[0].logged_by()
    # artifact からグラフを下方向にたどります:
    consumer_runs = produced_artifacts[0].used_by()
    ```
  </Tab>
</Tabs>

***

<Badge stroke shape="pill" color="orange" size="md">[Artifacts](/ja/support/models/tags/artifacts)</Badge>
