メインコンテンツへスキップ
Artifacts の descriptionmetadata 、および alias を更新するには、希望する値を渡します。次に save() メソッドを呼び出して、 W&B サーバー上の Artifacts を更新します。 Artifacts の更新は、 W&B Run の実行中、または Run の外から行うことができます。
Artifact.save() と wandb.Run.log_artifact() の使い分け
  • 既存の Artifacts を新しい Run を作成せずに更新する場合は、 Artifact.save() を使用してください。
  • 新しい Artifacts を作成し、それを特定の Run に関連付ける場合は、 wandb.Run.log_artifact() を使用してください。
Run の外で Artifacts を更新するには、 W&B Public API (wandb.Api) を使用します。 Run の実行中に Artifacts を更新するには、 Artifact API (wandb.Artifact) を使用します。
Model Registry 内のモデルにリンクされている Artifacts の エイリアス を更新することはできません。
次のコード例は、 wandb.Artifact API を使用して Artifacts の説明(description)を更新する方法を示しています。
import wandb

# プロジェクト名を指定して Run を開始
with wandb.init(project="<example>") as run:
    # 使用する Artifacts を取得
    artifact = run.use_artifact("<artifact-name>:<alias>")
    # 説明を更新
    artifact.description = "<description>"
    # 変更を保存
    artifact.save()