Databricks を設定する
-
クラスターに wandb をインストールする
クラスター設定にアクセスし、対象のクラスターを選択して Libraries をクリックします。次に Install New をクリックし、PyPI を選択してパッケージ
wandbを追加します。 -
認証を設定する
W&B アカウントを認証するには、ノートブックからクエリできる Databricks シークレットを追加します。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Help us improve these docs. Take our quick survey.
Spark クラスター 上で実験管理、メトリクスのログ記録、モデル管理を行えるように、W&B を Databricks と統合します。
wandb を追加します。
# databricks cli をインストールする
pip install databricks-cli
# databricks UI でトークンを生成する
databricks configure --token
# 2 つのコマンドのいずれかを使ってスコープを作成する(databricks で security features が有効かどうかによって異なります):
# security add-on あり
databricks secrets create-scope --scope wandb
# security add-on なし
databricks secrets create-scope --scope wandb --initial-manage-principal users
# https://wandb.ai/settings で APIキー を作成する
databricks secrets put --scope wandb --key api_key
import os
import wandb
api_key = dbutils.secrets.get("wandb", "api_key")
wandb.login(key=api_key)
with wandb.init() as run:
run.log({"foo": 1})
import os
# これらは将来的には不要になります
os.environ["WANDB_ENTITY"] = "my-entity"
os.environ["WANDB_PROJECT"] = "my-project-that-exists"
Was this page helpful?