tracker register wandb_tracker \

--flavor=wandb \--entity={{wandb_secret.entity}} \

--project_name={{wandb_secret.project_name}} \

--api_key={{wandb_secret.api_key}}

...

Read more about ZenML Secrets in the ZenML documentation.

For more, up-to-date information on the Weights & Biases Experiment Tracker implementation and its configuration, you can have a look at the SDK docs .

How do you use it?

To be able to log information from a ZenML pipeline step using the Weights & Biases Experiment Tracker component in the active stack, you need to enable an experiment tracker using the @step decorator. Then use Weights & Biases logging or auto-logging capabilities as you would normally do, e.g.:

import wandb

from wandb.integration.keras import WandbCallback

@step(experiment_tracker="<WANDB_TRACKER_STACK_COMPONENT_NAME>")

def tf_trainer(

config: TrainerConfig,

x_train: np.ndarray,

y_train: np.ndarray,

x_val: np.ndarray,

y_val: np.ndarray,

) -> tf.keras.Model:

...

model.fit(

x_train,

y_train,

epochs=config.epochs,

validation_data=(x_val, y_val),

callbacks=[

WandbCallback(

log_evaluation=True,

validation_steps=16,

validation_data=(x_val, y_val),

],

metric = ...

wandb.log({"<METRIC_NAME>": metric})

Instead of hardcoding an experiment tracker name, you can also use the Client to dynamically use the experiment tracker of your active stack:

from zenml.client import Client

experiment_tracker = Client().active_stack.experiment_tracker

@step(experiment_tracker=experiment_tracker.name)

def tf_trainer(...):

...

Weights & Biases UI

Weights & Biases comes with a web-based UI that you can use to find further details about your tracked experiments.

Every ZenML step that uses Weights & Biases should create a separate experiment run which you can inspect in the Weights & Biases UI:

You can find the URL of the Weights & Biases experiment linked to a specific ZenML run via the metadata of the step in which the experiment tracker was used:

from zenml.client import Client