> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wandb.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Sweeps

<Card title="Best practices to organize hyperparameter searches" href="/support/models/articles/best-practices-to-organize-hyperparamete" arrow="true" horizontal>
  When you run many hyperparameter searches, tag your runs so you can group and find related experiments later. Tag runs i ...
</Card>

<Card title="Can I resume a run inside a sweep?" href="/support/models/articles/can-i-resume-a-run-inside-a-sweep" arrow="true" horizontal>
  Run resumption is not supported inside a W\&B sweep. If you pass a run\_id or use wandb.init(resume=...) while a sweep age ...
</Card>

<Card title="How can I change the directory my sweep logs to locally?" href="/support/models/articles/how-can-i-change-the-directory-my-sweep-" arrow="true" horizontal>
  Set the logging directory for run data by configuring the WANDB\_DIR environment variable. For example:
</Card>

<Card title="How can I resume a sweep using Python code?" href="/support/models/articles/how-can-i-resume-a-sweep-using-python-co" arrow="true" horizontal>
  To resume a sweep, pass the sweep\_id to the wandb.agent() function.
</Card>

<Card title="How do I best log models from runs in a sweep?" href="/support/models/articles/how-do-i-best-log-models-from-runs-in-a-" arrow="true" horizontal>
  To log models in a sweep, create a model artifact for the sweep. Each version represents a different run from the sweep. ...
</Card>

<Card title="How do I enable code logging with Sweeps?" href="/support/models/articles/how-do-i-enable-code-logging-with-sweeps" arrow="true" horizontal>
  To enable code logging for sweeps, add wandb.log\_code() after initializing the W\&B Run. This step is necessary even when ...
</Card>

<Card title="How do I fix `CommError, Run does not exist` during a sweep?" href="/support/models/articles/commerror-run-does-not-exist-during-swee" arrow="true" horizontal>
  If you see both CommError, Run does not exist and ERROR Error uploading during a sweep, the most likely cause is that yo ...
</Card>

<Card title="How do I fix `Cuda out of memory` during a sweep?" href="/support/models/articles/cuda-out-of-memory-during-a-sweep" arrow="true" horizontal>
  If you see Cuda out of memory during a sweep, refactor your code to use process-based execution. Rewrite your code as a  ...
</Card>

<Card title="How do I fix an `anaconda 400 error` during a sweep?" href="/support/models/articles/anaconda-400-error-during-a-sweep" arrow="true" horizontal>
  An anaconda 400 error during a sweep often means you didn't log the metric you're optimizing. You might see: The sweep c ...
</Card>

<Card title="How do I flag boolean variables as hyperparameters?" href="/support/models/articles/how-do-i-flag-boolean-variables-as-hyperparameters" arrow="true" horizontal>
  To pass hyperparameters as boolean flags, use the macro in the command section of your sweep configuration. The macro au ...
</Card>

<Card title="How do I rerun a grid search?" href="/support/models/articles/how-do-i-rerun-a-grid-search" arrow="true" horizontal>
  If a grid search completes but some W\&B Runs crashed, delete those runs to rerun them. Then select the Resume button on  ...
</Card>

<Card title="How do I set default hyperparameter values in a sweep?" href="/support/models/articles/how-do-i-set-default-hyperparameter-values-in-a-sweep" arrow="true" horizontal>
  You don't need to provide values for every hyperparameter in a W\&B Sweep. You can set defaults and let the sweep overrid ...
</Card>

<Card title="How do I use W&B Sweeps with SageMaker?" href="/support/models/articles/how-do-i-use-sweeps-with-sagemaker" arrow="true" horizontal>
  You can use W\&B Sweeps with Amazon SageMaker to run hyperparameter searches on SageMaker training jobs. To authenticate  ...
</Card>

<Card title="How do I use W&B Sweeps with cloud infrastructure?" href="/support/models/articles/how-do-i-use-sweeps-with-cloud-infrastructure" arrow="true" horizontal>
  To run a W\&B Sweep on cloud infrastructure such as AWS Batch or ECS, publish the sweep\_id so that any W\&B Sweep agent ca ...
</Card>

<Card title="How do I use custom CLI commands with sweeps?" href="/support/models/articles/how-do-i-use-custom-cli-commands-with-sw" arrow="true" horizontal>
  You can use W\&B Sweeps with custom CLI commands if training configuration passes command-line arguments. This lets you r ...
</Card>

<Card title="How do I use the parallel coordinates chart in W&B?" href="/support/models/articles/how-do-i-use-the-parallel-coordinates-chart-in-wandb" arrow="true" horizontal>
  The parallel coordinates chart shows how hyperparameters relate to metrics across many runs. Each line is one run; each  ...
</Card>

<Card title="How should I run sweeps on SLURM?" href="/support/models/articles/how-should-i-run-sweeps-on-slurm" arrow="true" horizontal>
  For W\&B sweeps on the SLURM scheduling system, run wandb agent --count 1 SWEEP\_ID in each scheduled job. The agent execu ...
</Card>

<Card title="Is there a way to add extra values to a sweep, or do I need to start a new one?" href="/support/models/articles/is-there-a-way-to-add-extra-values-to-a-" arrow="true" horizontal>
  Once a W\&B Sweep starts, you can't change the sweep configuration. However, you can navigate to any table view, select r ...
</Card>

<Card title="Optimizing multiple metrics" href="/support/models/articles/optimizing-multiple-metrics" arrow="true" horizontal>
  W\&B Sweeps optimize a single objective metric. To optimize multiple metrics in a single run, combine them into a weighte ...
</Card>

<Card title="What happens if I edit my Python files while a sweep is running?" href="/support/models/articles/what-happens-if-i-edit-my-python-files-w" arrow="true" horizontal>
  The behavior depends on which file you edit. While a sweep is running: If the train.py script that the sweep uses change ...
</Card>

<Card title="What is the `Est. Runs` column?" href="/support/models/articles/what-is-the-est-runs-column" arrow="true" horizontal>
  W\&B provides an estimated number of runs generated when creating a W\&B Sweep with a discrete search space. This total re ...
</Card>

<Card title="Why is my sweep agent not picking up new runs?" href="/support/models/articles/why-is-my-sweep-agent-not-picking-up-new-runs" arrow="true" horizontal>
  If your sweep agent starts but does not receive new run configurations, or receives one run and then idles, there are se ...
</Card>
