Questions about Hydra, an open source Python framework by Facebook
Questions tagged [fb-hydra]
182 questions
0
votes
2 answers
Using SageMaker with Hydra
I have a question about SageMaker and Hydra.
TL;DR
Is there a way to pass arguments from SageMaker estimator to a Hydra script? Currently it passes parameters in a very strict way.
Full Question
I use Hydra in order to pass configs to my training…

David Lasry
- 829
- 3
- 12
- 31
0
votes
1 answer
Can't create a multiprocessing Manager when using hydra
I am developing a code where I need to create a Manager to synchronize a Queue. In the project I am using hydra and everything works fine until I create a multiprocessing Manager Object. This is the raised error with HYDRA_FULL_ERROR=1:
Primary…

Alex Ferrando
- 13
- 2
0
votes
1 answer
Share common configuration items among hydra config groups
I have two sets of config groups, from which I need to select one config file each time.
the file structure looks like this:
conf
├── datasets
│ ├── A
│ │ ├── a1.yaml
│ │ └── a2.yaml
│ └── B
│ ├── b1.yaml
│ └── b2.yaml
└──…

Allaire Black
- 1
- 1
0
votes
1 answer
Hydra: how to use variable interpolation in packaged configs
I have some config file, model/foo.yaml:
# @package _global_
# foo.yaml
MODEL:
BACKBONE:
OUT_FEATURES: [c4, c5]
HEAD:
IN_FEATURES: ${MODEL.BACKBONE.OUT_FEATURES}
There are no issues with variable interpolation when I point to this…

Alnitak
- 2,068
- 2
- 12
- 24
0
votes
1 answer
Is it possible to import just a single configuration parameter, not all in Hydra?
constants_config.yaml
site: fb
another_site: google
my_config.yaml
my_site: ${constants_config.yaml]
Resulting my_config.yaml
my_site: fb
I just want to get a single constant, not the whole constants_config.yaml (which is done by using default)

labyrinthdeux
- 95
- 6
0
votes
1 answer
hydra override an interpolated dict value in .yaml config
Let's say I have a config like the following:
foo:
a : 1
b : 2
c :
aa : ???
bb : 2
bar : ${foo.c}
baz : ${foo.c}
and want to specialise (or override) aa in bar and baz. Is there a clean way to do this? I can't see how to do this with…

BenedictWilkins
- 1,173
- 8
- 25
0
votes
1 answer
Hydra - Override parameters when instantiating function
I am working on a data pipeline that follows a structure like this:
-- src/
---- etl.py
---- scripts/
------ moduleA.py
------ moduleB.py
I want to parametrise the scripts with Hydra. I have already done it for moduleA, which can be run…

irenels
- 3
- 2
0
votes
1 answer
Hydra - Cannot override value in instantiate
I am developing a project based on the pytorch lightning + hydra template found here https://github.com/ashleve/lightning-hydra-template. I am trying to instantiate a Pytorch dataset object using hydra instantiate, overriding the default cfg value…

fred_101512
- 36
- 5
0
votes
1 answer
Using hydra.main on main method
Summary of the problem:
I'm running a requests call on an API endpoint, whose request params are hidden in a config file and I decided to try out hydra to retrieve those params [Reason being the request params do change as I'm working on collecting…

Soulpianist96
- 21
- 1
- 5
0
votes
1 answer
Python Hydra configuration for different environments
Background
I currently have a script which does some API data gathering. The script is deployed to two environments, test and user. Each environment has different settings which I have created the respective configuration files. I am currently…

Raymond C.
- 572
- 4
- 24
0
votes
1 answer
Validate classes (hydra-core lists) with pydantic
1. Context
How to validate a specific class in pydantic?
I'm using pydantic to validate yaml list parameters parsed by hydra, to later be passed to modeling routines. The problem is that the hydra dictionary contains not a list of values, but a…

Leonardo
- 5
- 4
0
votes
2 answers
Cannot customize logging behaviour in Hydra (fb-hydra)
I am new to Hydra and this is my first question in SO.
My purpose is to customize logging according to this example.
I have the following folder structure for configs:
configs/
├── dataset_structurizers
│ ├── config.yaml
│ └── datasets
│ …

Yere
- 59
- 2
- 8
0
votes
0 answers
Hydra: Use `# @package _global_` only on a part of a file
I would like to use the # @package _global_ directive only on a specific part of my config. E.g. here I want my datamodule to be able to override an attribute of the trainer.
Is there any way to do that?
Things I tried:
Using # @package _global_ at…

Louis M
- 4,036
- 4
- 21
- 25
0
votes
1 answer
How to get the file path of a loaded OmegaConf configuration
I am using OmegaConf to read a .yaml configuration file (file path is given through hydra).
After I edit it, I want to save the file again. Possibly using:
OmegaConf.save(conf, filepath, resolve=True)
However, I cannot figure out how to get the…

anxiousPI
- 183
- 1
- 12
0
votes
1 answer
override list dictionalry element in FB hydra
I have a configuration which I am defining as follows:
preprocessing
_target_: make_pipeline
steps_config:
- ColumnMapper:
_target_: ColumnMapper
columns: null
- SeriesMaker:
_target_: SeriesMaker
time_column: null
…

Luca
- 10,458
- 24
- 107
- 234