How do I launch multiple runs from one script?
less than a minute
Use wandb.init
and run.finish()
to log multiple runs within a single script:
- Use
run = wandb.init(reinit=True)
to allow reinitialization of runs. - Call
run.finish()
at the end of each run to complete logging.
import wandb
for x in range(10):
run = wandb.init(reinit=True)
for y in range(100):
wandb.log({"metric": x + y})
run.finish()
Alternatively, utilize a Python context manager to automatically finish logging:
import wandb
for x in range(10):
run = wandb.init(reinit=True)
with run:
for y in range(100):
run.log({"metric": x + y})
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.