You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>>> from dataclasses import dataclass
>>> from typing import List
>>> @dataclass
... class test_class:
... x: List[float] = "${optimization.lr}"
...
>>> dc = test_class()
>>> a = DictConfig(dc)
>>> b = DictConfig({"x": [0.1]})
>>> OmegaConf.merge(a,b)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/private/home/abaevski/.conda/envs/fairseq-fp16-20200821/lib/python3.6/site-packages/omegaconf/omegaconf.py", line 321, in merge
target.merge_with(*others[1:])
File "/private/home/abaevski/.conda/envs/fairseq-fp16-20200821/lib/python3.6/site-packages/omegaconf/basecontainer.py", line 327, in merge_with
self._format_and_raise(key=None, value=None, cause=e)
File "/private/home/abaevski/.conda/envs/fairseq-fp16-20200821/lib/python3.6/site-packages/omegaconf/base.py", line 101, in _format_and_raise
type_override=type_override,
File "/private/home/abaevski/.conda/envs/fairseq-fp16-20200821/lib/python3.6/site-packages/omegaconf/_utils.py", line 675, in format_and_raise
_raise(ex, cause)
File "/private/home/abaevski/.conda/envs/fairseq-fp16-20200821/lib/python3.6/site-packages/omegaconf/_utils.py", line 591, in _raise
raise ex # set end OC_CAUSE=1 for full backtrace
omegaconf.errors.ConfigKeyError: str interpolation key 'optimization.lr' not found
full_key:
reference_type=Any
object_type=test_class
if instead you set a to be DictConfig initialized from a dict, everything works
>>> a = DictConfig({'x': '${optimization.lr}'})
>>> OmegaConf.merge(a,b)
{'x': [0.1]}
The text was updated successfully, but these errors were encountered:
repro:
if instead you set a to be DictConfig initialized from a dict, everything works
The text was updated successfully, but these errors were encountered: