How to use Hydra Sweeper with a list parameter? #2906
-
|
Hi, I am struggling to get the Hydra Sweeper to work in the following scenario. Among some other configuration files, I have one that is as the following:
However, I want to create a Hydra Sweeper to try different combinations of this versions. Something like: Is this possible? I have been trying all possible sintax combinations and none of them work. The ones that pass through the Hydra parser just create a single job instead of two. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
|
If |
Beta Was this translation helpful? Give feedback.
-
|
@mainrs thanks for the help, really appreciated. However, if I do that and set the sweeper as: What I endup having is this: and then my loaded config is basically a list with both versions... basically the sweeper does not get that I want to sweep over two different lists as I expect: |
Beta Was this translation helpful? Give feedback.
-
|
hydra.sweeper.params is a simple wrapper on top of the Compose API that takes a list of key=value strings (similar to what you pass in the command line). Try this. hydra:
sweeper:
params:
dataset.segmentation.dvc_versions: "[v1.1.0], [v2.0.0]" |
Beta Was this translation helpful? Give feedback.
hydra.sweeper.params is a simple wrapper on top of the Compose API that takes a list of key=value strings (similar to what you pass in the command line).
Since YAML got its own idea of what is a list, you need to quote the string to avoid YAML parsing it if you want to pass a list there.
Try this.