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
Bug Report: Inconsistent Handling of string values in merge_from_file()
Description:
I encountered an issue when using merge_from_file() with a YAML configuration where the key seq: stores a sequence subfolder name as strings ("00", "01", "02", ..., "10", "11", etc.).
Expected behavior: When seq: '03' is specified in the YAML file, the merge works without issues.
Issue: However, when seq: '10' is used, I receive a ValueError indicating a type mismatch between str and int.
Error Message:
Traceback (most recent call last):
File "[PATH]/yac/main.py", line 5, in <module>
cfg.merge_from_file("experiment.yaml")
File "[PATH]/python3.12/site-packages/yacs/config.py", line 213, in merge_from_file
self.merge_from_other_cfg(cfg)
File "[PATH]/python3.12/site-packages/yacs/config.py", line 217, in merge_from_other_cfg
_merge_a_into_b(cfg_other, self, self, [])
File "[PATH]/python3.12/site-packages/yacs/config.py", line 474, in _merge_a_into_b
v = _check_and_coerce_cfg_value_type(v, b[k], k, full_key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "[PATH]/python3.12/site-packages/yacs/config.py", line 534, in _check_and_coerce_cfg_value_type
raise ValueError(
ValueError: Type mismatch (<class 'str'> vs. <class 'int'>) with values (01 vs. 10) for config key: seq
Example Code:
Here’s a simplified version of the code demonstrating the issue:
Bug Report: Inconsistent Handling of string values in
merge_from_file()
Description:
I encountered an issue when using
merge_from_file()
with a YAML configuration where the keyseq:
stores a sequence subfolder name as strings ("00", "01", "02", ..., "10", "11", etc.).seq: '03'
is specified in the YAML file, the merge works without issues.seq: '10'
is used, I receive aValueError
indicating a type mismatch betweenstr
andint
.Error Message:
Example Code:
Here’s a simplified version of the code demonstrating the issue:
config.py
main.py
YAML File: working
YAML File: with error
The text was updated successfully, but these errors were encountered: