Weights & Biases: log experiments and metrics

domain: docs.wandb.ai · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Install the wandb package and authenticate by running wandb login with your API key, or set the WANDB_API_KEY environment variable.
  2. Initialize a run at the start of your script with wandb.init(project='PROJECT_NAME', config=hyperparams_dict).
  3. Log scalar metrics during training with wandb.log({'loss': loss_val, 'accuracy': acc_val}) inside the training loop.
  4. Log media such as images, audio, or plots using wandb.log({'sample': wandb.Image(img_array)}) or equivalent typed objects.
  5. Save model checkpoints or other files to the run with wandb.save(filepath) or log them as artifacts using wandb.Artifact.
  6. Call wandb.finish() at the end of the script to flush remaining data and mark the run complete; in a notebook this is optional but recommended.

Known gotchas

Related routes

Log and retrieve model artifacts with Weights & Biases Artifacts for dataset versioning
docs.wandb.ai · 5 steps · unrated
MLflow tracking: log runs and metrics
mlflow.org/docs · 6 steps · unrated
Correlate traces, metrics, and logs using OTel exemplars and trace context injection for a unified debugging workflow
opentelemetry.io · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans