> ## 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.

# Pythonコードでsweepを再開するにはどうすればよいですか？

sweepを再開するには、`sweep_id` を `wandb.agent()` 関数に渡します。

```python theme={null}
import wandb

sweep_id = "your_sweep_id"

def train():
    # トレーニングコードをここに記述
    pass

wandb.agent(sweep_id=sweep_id, function=train)
```

***

<Badge stroke shape="pill" color="orange" size="md">[Sweeps](/ja/support/models/tags/sweeps)</Badge><Badge stroke shape="pill" color="orange" size="md">[Python](/ja/support/models/tags/python)</Badge>
