Hello,
I have been debugging a bit with hydra and it has been a pain when the error happens in some interpolation inside the config. Indeed, when it raises an error, it doesn't completely specify what is the mistake and where the error happens.
for example let's take this cfg.yaml :
target: dummyclass
point_hf:
pos
anisotropy
num_hf_point: ${eval:'sum([ ${feat_size}[k] for k in ${point_hf} ])'}
feat_size:
pos : 3
and this code :
import hydra
from omegaconf import DictConfig, OmegaConf
import time
OmegaConf.register_new_resolver("eval", eval)
@hydra.main(version_base="1.2", config_path="./config/", config_name="config")
def my_app(cfg : DictConfig) -> None:
instantiate= hydra.utils.instantiate
instantiate(cfg)
class dummyclass:
def init(self,point_hf,num_hf_point):
self.point_hf=point_hf
self.num_hf_point=num_hf_point
if name=="main":
my_app()
if you run it : you got the only meaningful error :
omegaconf.errors.InterpolationResolutionError: KeyError raised while resolving interpolation: 'anisotropy'
the main issue is that you don't know what was the key that made the mistake and where the interpolation failed.
the issue could have been on omegaconf but if we change the code with :
Hello, I have been debugging a bit with hydra and it has been a pain when the error happens in some interpolation inside the config. Indeed, when it raises an error, it doesn't completely specify what is the mistake and where the error happens. for example let's take this cfg.yaml :
if you run it : you got the only meaningful error :
the main issue is that you don't know what was the key that made the mistake and where the interpolation failed. the issue could have been on omegaconf but if we change the code with :
the errors becomes:
which is much more easy to maintain