Questions about Hydra, an open source Python framework by Facebook
Questions tagged [fb-hydra]
182 questions
1
vote
1 answer
How can I organize Hydra 1.3 configuration files and import them into each other?
I am trying to use Hydra 1.3 contrive a simple, but apparently not trivial, configuration that maps endpoints of a given API to their corresponding processing functions.
So far, I came up with a config folder structure that looks like:
$ tree…

Índio
- 539
- 5
- 12
1
vote
0 answers
Is there a way to use Ray Tune in combination with ML Flow and Hydra in Python?
I want to do hyperparameter tuning for a neural net, created with keras. For this project I handle my config.yaml files with hydra, use mlflow to store the metrics and parameters from the optimization and use ray to parallelize the computation of…

Patrick
- 11
- 2
1
vote
1 answer
Set Hydra enviroment with uvicorn/fastapi
I have a FastAPI application that is going to production soon, however i am facing some problems with hydra integration.
First i could not run the @hydra.main() decorator on fastAPI endpoints. This was overcome with using the Hydra Compose API. Here…

Showertime
- 61
- 5
1
vote
1 answer
extend list from default config in Hydra
I have a list that is defined in my defaults
configuration file base_list:
list:
- 1
- 2
I know I can override the list values in the config file:
defaults:
- base_list
list:
- 3
- 4
which results
list:
- 3
- 4
However, I look for a way…

itamar kanter
- 1,170
- 3
- 10
- 25
1
vote
1 answer
How to access the Hydra config object at runtime
I need to change the output/working directory of the hydra config framework in such a way that it lies outside of my project directory. According to my understanding and the doc, config.yaml would need to look like this:
exp_nr: 0.0.0.0
condition:…

Autumn
- 41
- 7
1
vote
2 answers
How can I access to a help subsection from a hydra config file in a command line?
I am currently using the hydra config file as a part of a deep learning framework, in order to declare several parameters.
I wrote a help section in my config.yaml file to declare all the parameters and describe them:
help:
header: == HYDRA…

ofares
- 33
- 4
1
vote
1 answer
Access Hydra configuration parameters from different files
I'm trying to integrate hydra into my reinforcement learning code and I would like to access configuration parameters from different files, containing various functions and classes.
Short Example:
Main file main.py:
import…

Davide Ferrari
- 65
- 10
1
vote
1 answer
is there a way to modify log directory in hydra?
I am trying to modify log dir in hydra.
In default, output dir in hydra is like below.
outputs
└── 2022-11-12
├── 18-17-28
│ └── train.log
├── 18-18-37
│ └── train.log
└── 18-19-01
└── train.log
However, this folder…

이준혁
- 267
- 4
- 14
1
vote
1 answer
Conditional intializations of parameters in hydra
I'm pretty new to hydra and was wondering if the following thing is was possible: I have the parameter num_atom_feats in the model section which I would like to make dependent on the feat_type parameter in the data section. In particular, if I have…

James Arten
- 523
- 5
- 16
1
vote
1 answer
How to dynamically define project root path in config file?
I want to define project root path in Hydra config file without hardcoding it. 'til now couldn't find any feature of Hydra that can imply the path!
E.g., suppose we have the following project structure:
project-name
├── conf
│ ├── config.yaml
│ …

mbrb
- 393
- 1
- 2
- 12
1
vote
1 answer
How to create cli to access multi cli commands using hydra?
I want to package the repo and provide a cmd-line entry point for all the separate tasks managed by hydra. Let me explain with an example.
I have multiple tasks that are all powered by hydra. Each task has 3 possible operations. Let's look at only 2…

Ayush Chaurasia
- 583
- 4
- 18
1
vote
0 answers
ModuleNotFoundError: No module named 'hydra'
I'm trying to run a Python script but it gives an error immediately at the first line of code while trying importing hydra library via:
import hydra
The error i get is the following:
Traceback (most recent call last):
File "C:\Documenti\Python\01…

Mario
- 137
- 1
- 10
1
vote
1 answer
Handling high number of configuration parameters in python
In my Machine Learning project I have a high number of parameters that are loaded from a configuration file, e.g. a YAML file. I wonder, is there any best practice on how to integrate them in the codebase other than a number of 'setup_by_cfg'…

Haydnspass
- 67
- 6
1
vote
1 answer
Python - Hydra - Obtaining configuration in sub-module
Question
I am currently having trouble with getting hydra to work when not using @hydra.main in the main.py script (refer to error section). I have tried the compose API, but that prevents me from using most of the functionality that hydra provides.…

Raymond C.
- 572
- 4
- 24
1
vote
1 answer
define a value dynamically using hydra for yaml files
Let's say I have an app.py like this
class myClassA :
def __init__(self):
self.id = 100
class myClassB :
def __init__(self, objA, id):
pass
Is there a way to use hydra to have a config file like below work like it intuitively…

Aydin Abiar
- 334
- 3
- 11