Skip to main content

Best practices to organize hyperparameter searches

Set unique tags with wandb.init(tags=‘your_tag’). This allows efficient filtering of project runs by selecting the corre …

Can I rerun a grid search?

If a grid search completes but some W&B Runs need re-execution due to crashes, delete the specific W&B Runs to re-run. T …

Can I use Sweeps and SageMaker?

To authenticate W&B, complete the following steps: create a requirements.txt file if using a built-in Amazon SageMaker e …

Can we flag boolean variables as hyperparameters?

Use the macro in the command section of the configuration to pass hyperparameters as boolean flags. This macro automatic …

Can you use W&B Sweeps with cloud infrastructures such as AWS Batch, ECS, etc.?

To publish the sweep_id so that any W&B Sweep agent can access it, implement a method for these agents to read and execu …

Do I need to provide values for all hyperparameters as part of the W&B Sweep. Can I set defaults?

Access hyperparameter names and values from the sweep configuration using (run.config()), which acts like a dictionary. …

How can I change the directory my sweep logs to locally?

Set the logging directory for W&B run data by configuring the environment variable WANDB_DIR. For example:

How can I resume a sweep using Python code?

To resume a sweep, pass the sweep_id to the wandb.agent() function.

How do I best log models from runs in a sweep?

One effective approach for logging models in a sweep involves creating a model artifact for the sweep. Each version repr …

How do I enable code logging with Sweeps?

To enable code logging for sweeps, add wandb.log_code() after initializing the W&B Run. This action is necessary even wh …

How do I use custom CLI commands with sweeps?

You can use W&B Sweeps with custom CLI commands if training configuration passes command-line arguments. In the example …

How should I run sweeps on SLURM?

When using sweeps with the SLURM scheduling system, run wandb agent —count 1 SWEEP_ID in each scheduled job. This comma …

Is there a way to add extra values to a sweep, or do I need to start a new one?

Once a W&B Sweep starts, you cannot change the Sweep configuration. However, you can navigate to any table view, select …

Optimizing multiple metrics

To optimize multiple metrics in a single run, use a weighted sum of the individual metrics. Log the new combined metric …

What happens if I edit my Python files while a sweep is running?

While a sweep is running: If the train.py script which the sweep uses changes, the sweep continues to use the original t …

What is the `Est. Runs` column?

W&B provides an estimated number of Runs generated when creating a W&B Sweep with a discrete search space. This total re …