From 8441f2310b1144c59cf3e6c1351e2a6d33d2aa0e Mon Sep 17 00:00:00 2001 From: Jerry Jiarui XU Date: Tue, 5 May 2020 01:04:03 +0800 Subject: [PATCH] Update config Error msg (#267) --- mmcv/utils/config.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mmcv/utils/config.py b/mmcv/utils/config.py index 8c7610d26..44de988cc 100644 --- a/mmcv/utils/config.py +++ b/mmcv/utils/config.py @@ -151,9 +151,10 @@ class Config(object): if isinstance(v, dict) and k in b and not v.pop(DELETE_KEY, False): if not isinstance(b[k], dict): raise TypeError( - f'{k}={v} cannot be inherited from base because {k} ' - 'is a dict in the child config. You may ' - f'set `{DELETE_KEY}=True` to ignore the base config') + f'{k}={v} in child config cannot inherit from base ' + f'because {k} is a dict in the child config but is of ' + f'type {type(b[k])} in base config. You may set ' + f'`{DELETE_KEY}=True` to ignore the base config') b[k] = Config._merge_a_into_b(v, b[k]) else: b[k] = v