Programmatically running Sweeps using Hydra


I want to write a python script which runs multiple sweeps after another. My works with hydra, which I want to keep that way. Until now I was able to run sweeps using the command line and a config.yaml file which has at the end:

  • ${env}
  • python
  • ${program}
  • ${args_no_hyphens}
    Is there a way to bring this into the dictionary used in the function wandb.sweep in python?

Thanks in advance and best regards

Hi Kai,

Unfortunately, there is no way of bringing that to a dictionary.

The YAML-based sweep starts a whole process and a dictionary-based sweep starts a function.

So, there is no “command” parameter for dictionary-based sweeps, since you call wandb.agent and pass a function to it.


Hi Kai,

We wanted to follow up with you regarding your support request as we have not heard back from you. Please let us know if we can be of further assistance or if your issue has been resolved.

Weights & Biases

Hi Kai,
Since we have not heard back from you, we are going to close this request. If you would like to re-open the conversation, please let us know!


Hi Artisom,
sorry, it seems that I didn’t get a notification for your answer, thank you very much. I think I found a workaround for my problem, by adding this line to my dictionary it worked:

“command”: [

Best regards and sorry for the late reply