Installation
wandb>=0.12.12,<1.0.0- W&B SDKweave>=0.51.33,<1.0.0- W&B Weave for ML observabilityPillow>=9.1.0- Image processing for visualizations
Available Components
W&B Experiment Tracker
Track experiments, metrics, and artifacts with Weights & Biases
W&B Experiment Tracker
Track experiments and log metrics, parameters, and artifacts to Weights & Biases.Configuration
With API Key:entity- W&B team/username (optional, defaults to default entity)project_name- W&B project name (optional, defaults to “zenml-runs”)api_key- W&B API key (optional if set in environment)
Getting Your API Key
- Go to W&B Settings
- Find “API keys” section
- Copy your API key
- Use it in configuration or set as
WANDB_API_KEY
Usage in Steps
Basic Logging:Advanced Logging
Log Images:Run Configuration
Custom Run Names and Tags:Framework Integration
PyTorch:Complete Stack Example
W&B Features
Sweeps (Hyperparameter Optimization)
Reports
Create shareable reports in W&B UI:- Go to your project page
- Click “Create Report”
- Add charts, tables, and markdown
- Share with team or make public
Workspaces
Organize experiments in workspaces:- Filter runs by tags, parameters, or metrics
- Create custom charts and visualizations
- Compare multiple runs side-by-side
Best Practices
Use Tags for Organization
Use Tags for Organization
Log System Metrics
Log System Metrics
Enable system monitoring:
Use Artifacts for Reproducibility
Use Artifacts for Reproducibility
Version datasets and models:
Group Related Runs
Group Related Runs
W&B vs MLflow
| Feature | W&B | MLflow |
|---|---|---|
| Hosting | Cloud-based | Self-hosted or cloud |
| UI | Rich, modern | Functional |
| Collaboration | Built-in | Limited |
| Hyperparameter search | Built-in sweeps | External tools |
| Artifacts | Native support | Basic support |
| Cost | Free tier + paid | Free (self-hosted) |
| Setup complexity | Minimal | Moderate |
| Offline mode | Limited | Full support |
Common Issues
Login Required
Login Required
If you see login errors:
- Set API key:
export WANDB_API_KEY=your-key - Or login:
wandb login - Or pass in configuration:
api_key=your-key
Offline Mode
Offline Mode
To work without internet:
Rate Limiting
Rate Limiting
If you hit rate limits:
- Reduce logging frequency
- Batch log calls together
- Contact W&B for higher limits
Large Artifacts
Large Artifacts
For large files:
- Use artifact references instead of uploads
- Compress data before logging
- Use external storage with references
Next Steps
MLflow Integration
Compare with MLflow tracking
Experiment Tracking
Learn more about experiment tracking
Vertex AI Integration
Combine with GCP Vertex Experiments
W&B Docs
Official Weights & Biases documentation
