Questions tagged [fb-hydra]

Questions about Hydra, an open source Python framework by Facebook

182 questions
2
votes
1 answer

How to allow the user to override a subset of the configuration using their own yaml file?

Let's say I have this basic app: from dataclasses import dataclass import hydra from hydra.core.config_store import ConfigStore @dataclass class MyAppConfig: req_int: int opt_str: str = "Default String" opt_float: float = 3.14 cs =…
talz
  • 1,004
  • 9
  • 22
2
votes
2 answers

Passing argument/key pair to vscode Python debugger separated with an equal sign

For management of my config files, I'm using Hydra which requires passing additional arguments using a plus and then an equal sign between the argument and its value, e.g. python evaluate.py…
chronosynclastic
  • 1,585
  • 3
  • 19
  • 40
2
votes
2 answers

Use a parameter multiple times in hydra config file

I am currently trying to replace the usage of argparse with hydra files to set the hyperparameters of a deep learning neural network. I succeeded in using a config.yaml file linked to a hydra main file to run a training and a prediction. However, I…
ofares
  • 33
  • 4
2
votes
1 answer

Using Hydra Configuration inside Classes

I am trying to use the hydra tool in my project and would like to use the decorator for class functions import hydra from hydra.core.config_store import ConfigStore from src.config import RecordingConfig cs =…
Tom
  • 51
  • 7
2
votes
2 answers

Use config not packaged with installed Hydra app

When packaging a Hydra application and including a script as an entry point, one can call the script from the command line anywhere. When called the script will utilize the configuration that was included in the package. Is there a way to modify the…
Grr
  • 15,553
  • 7
  • 65
  • 85
2
votes
1 answer

Hydra remove default via config file

I am using Hydra to configure my Python application. I really like how it is possible to have a default config and create "overwrites" for certain config properties. However, I can't figure out how to remove a property from the run (eg. delete the…
Alexus
  • 1,282
  • 1
  • 12
  • 20
2
votes
1 answer

Is there a way to auto-match multiple parameters the same?

I have multiple deep neural networks in my model and want them to have the same input sizes (networks are of different classes). For example, my model is: class Model: def __init__(self, cfg: DictConfig): self.net1 = Net1(**cfg.net1_hparams) …
nzer0
  • 315
  • 2
  • 10
2
votes
1 answer

Pipreqs generate incorrect requiremnets for Hydra

I'm using pipreqs for generating requirements.txt. I started using hydra package (see https://hydra.cc/ or hydra-core package on PyPI). So I would like pipreqs to add hydra-core dependency automatically when I run. But, when I checked output of…
Nerxis
  • 3,452
  • 2
  • 23
  • 39
2
votes
1 answer

Best way to use hydra during deep learning model inference

I am currently experimenting with hydra-conf for my deep learning project. For training, i follow the way shown in the documentation: folder of configuration files, a main config.yml file with additional configurations groups in extra folders my…
Eti49
  • 140
  • 11
2
votes
1 answer

How to set hydra's parameter HYDRA_FULL_ERROR?

When I use hydra in a python pytorch project, the operation result prompt “Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.” But i don't konw how to set it.
najixzyc
  • 21
  • 1
  • 1
  • 3
2
votes
1 answer

fb-hydra: How to implement 2 nested structured configs?

I have 2 sub configs and one master(?) config that having those sub configs. I designed configs like below: from dataclasses import dataclass, field import hydra from hydra.core.config_store import ConfigStore from omegaconf import MISSING,…
user3595632
  • 5,380
  • 10
  • 55
  • 111
2
votes
3 answers

how to log hydra's multi-run in mlflow

I am trying to manage the results of machine learning with mlflow and hydra. So I tried to run it using the multi-run feature of hydra. I used the following code as a test. import mlflow import hydra from hydra import utils from pathlib import…
musako
  • 897
  • 2
  • 10
  • 26
1
vote
2 answers

Default (nested) dataclass initialization in hydra when no arguments are provided

I have the following code, using the hydra framework # dummy_hydra.py from dataclasses import dataclass import hydra from hydra.core.config_store import ConfigStore from omegaconf import DictConfig, OmegaConf @dataclass class Foo: x: int =…
noamgot
  • 3,962
  • 4
  • 24
  • 44
1
vote
0 answers

Use Hydra to populate nested dataclass objects

I have a yaml config file that has the following structure paths: log: ./runs data: ./data data: downloads: [ { name: "1", url: "url_1", file: "file_1" }, …
Dan Jackson
  • 185
  • 1
  • 9
1
vote
1 answer

How to use hydra compose API to read yaml from a nested directory?

I am trying to print the src.yaml from a nested directory below Main_dir: conf: project: test_project1: env: source: src.yaml src.yaml table: TEST_TABLE DB:Test_DB I tried the following hydra…
Hari
  • 89
  • 4
1 2
3
12 13