Tutorial: Use W&B for model management
Learn how to use W&B for Model Management
3 minute read
W&B will no longer support W&B Model Registry after 2024. Users are encouraged to instead use W&B Registry for linking and sharing their model artifacts versions. W&B Registry broadens the capabilities of the legacy W&B Model Registry. For more information about W&B Registry, see the Registry docs.
W&B will migrate existing model artifacts linked to the legacy Model Registry to the new W&B Registry in the Fall or early Winter of 2024. See Migrating from legacy Model Registry for information about the migration process.
The W&B Model Registry houses a team’s trained models where ML Practitioners can publish candidates for production to be consumed by downstream teams and stakeholders. It is used to house staged/candidate models and manage workflows associated with staging.
With W&B Model Registry, you can:
Track and manage your staged models with a few simple steps.
The following code snippet demonstrates how to log and link a model to the Model Registry:
import wandb
import random
# Start a new W&B run
run = wandb.init(project="models_quickstart")
# Simulate logging model metrics
run.log({"acc": random.random()})
# Create a simulated model file
with open("my_model.h5", "w") as f:
f.write("Model: " + str(random.random()))
# Log and link the model to the Model Registry
run.link_model(path="./my_model.h5", registered_model_name="MNIST")
run.finish()
Depending on your use case, explore the following resources to get started with W&B Models:
Learn how to use W&B for Model Management
Model Registry terms and concepts
Track a model, the model’s dependencies, and other information relevant to that model with the W&B Python SDK.
Create a registered model to hold all the candidate models for your modeling tasks.
Link a model version to a registered model with the W&B App or programmatically with the Python SDK.
Add descriptions to model card to document your model
How to download a model with W&B Python SDK
Get Slack notifications when a new model version is linked to the model registry.
Use model registry role based access controls (RBAC) to control who can update protected aliases.
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.