diff --git a/example/config.py b/example/config.py index 1eade47..b0eac80 100644 --- a/example/config.py +++ b/example/config.py @@ -10,4 +10,6 @@ _C.TRAIN.HYPERPARAMETER_1 = 0.1 _C.TRAIN.SCALES = (2, 4, 8, 16) +_C.DATASETS = CN(new_allowed=True) + cfg = _C diff --git a/example/config.yaml b/example/config.yaml index d1e9fdd..a352f21 100644 --- a/example/config.yaml +++ b/example/config.yaml @@ -2,3 +2,7 @@ SYSTEM: NUM_GPUS: 2 TRAIN: SCALES: (1, 2) +DATASETS: + train_2017: + 17: 1 + 18: 1 diff --git a/yacs/config.py b/yacs/config.py index e39898d..54bec35 100644 --- a/yacs/config.py +++ b/yacs/config.py @@ -129,7 +129,7 @@ def _create_config_tree_from_dict(cls, dic, key_list): _assert_with_logging( _valid_type(v, allow_cfg_node=False), "Key {} with value {} is not a valid type; valid types: {}".format( - ".".join(key_list + [k]), type(v), _VALID_TYPES + ".".join(key_list + [str(k)]), type(v), _VALID_TYPES ), ) return dic