2

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 property). I saw that via terminal this can be done with python run.py ~foo.bar, but I was wondering how I can do the same with a config file?

For example, in the following config file I am overwriting the max_epochs, but how would I remove the property max_epochs all together?

defaults:
  - override /trainer: minimal.yaml # choose trainer from 'configs/trainer/'

# all parameters below will be merged 
# with parameters from default configurations set above
# this allows you to overwrite only specified parameters
trainer:
  min_epochs: 1
  max_epochs: 100 
  check_val_every_n_epoch: 20 
  gpus: 1
Alexus
  • 1,282
  • 1
  • 12
  • 20

1 Answers1

1

You can't do it from a config file. I suggest that you structure your config in an additive way. Add what you need, instead of removing what you don't.

Omry Yadan
  • 31,280
  • 18
  • 64
  • 87