Eudald
Eudald

Reputation: 378

How to upload extra config data in a wandb sweep

Usually, one can upload config data to wandb init like this:

MODEL_CONFIG = {
    "num_epochs": config.num_epochs,
    "batch_size": config.batch_size,
    "base_lr": config.base_lr
}

wandb.init(config=MODEL_CONFIG)

The problem is that, when I do a sweep, like in the collab example:

sweep_config = {
    "method": "bayes",
    "metric": {"name": "accuracy", "goal": "maximize"},
    "parameters": {"some_other_parameter": {"values": [1, 2, 3]}}

sweep_id = wandb.sweep(sweep_config, project="please-help")

def train(config=None):
    # Initialize a new wandb run
    with wandb.init(config=config):
        # If called by wandb.agent, as below,
        # **this config will be set by Sweep Controller**
        config = wandb.config
        ...
wandb.agent(sweep_id, train, count=5)

This config parameter gets phagocyted by the sweep mechanism, and I can't use it to upload extra information. I know that I could add extra info in a table or something like this, but I really like how tidy it is when in the "Overview" page.

Am I missing something? Is there a way around this?

Upvotes: 0

Views: 23

Answers (0)

Related Questions