Debugging modules with hydra

Hello,

I am trying to use hydra to configure my deep learning repo. One thing that is unclear to me is how to debug modules which utilize hydra configuration. From the DVC documentation it looks like we are supposed to remove the @hydra.main from our module, but then how can we access our config when we are not using dvc exp run, e.g. when we want to debug the script? I tried to use dvc.api.params_show() but it does not seem trigger hydra composition and writing of a params.yaml file.

What is the intended workflow here?

Thanks

1 Like

I tentatively have a workaround: GitHub - gregstarr/lstm_seq2seq: LSTM sequence-2-sequence example project

At the start of the script I check if it’s running behind dvc exp run using the DVC_EXP_BASELINE_REV environment variable. If it’s not, I call dvc.utils.hydra.compose_and_dump to update params.yaml.

I’m not sure if this is the intended workflow but it is one way to make sure your params.yaml is updated before loading it

1 Like