diff --git a/mmengine/logging/message_hub.py b/mmengine/logging/message_hub.py index 18fb624b3a..79fc131ae4 100644 --- a/mmengine/logging/message_hub.py +++ b/mmengine/logging/message_hub.py @@ -173,19 +173,18 @@ def update_scalars(self, log_dict: dict, resumed: bool = True) -> None: assert isinstance(log_dict, dict), ('`log_dict` must be a dict!, ' f'but got {type(log_dict)}') for log_name, log_val in log_dict.items(): - self._set_resumed_keys(log_name, resumed) if isinstance(log_val, dict): assert 'value' in log_val, \ f'value must be defined in {log_val}' count = self._get_valid_value(log_val.get('count', 1)) - checked_value = self._get_valid_value(log_val['value']) + value = log_val['value'] else: count = 1 - checked_value = self._get_valid_value(log_val) + value = log_val assert isinstance(count, int), ('The type of count must be int. but got ' f'{type(count): {count}}') - self.update_scalar(log_name, checked_value, count) + self.update_scalar(log_name, value, count, resumed) def update_info(self, key: str, value: Any, resumed: bool = True) -> None: """Update runtime information. @@ -208,7 +207,6 @@ def update_info(self, key: str, value: Any, resumed: bool = True) -> None: could be resumed. """ self._set_resumed_keys(key, resumed) - self._resumed_keys[key] = resumed self._runtime_info[key] = value def update_info_dict(self, info_dict: dict, resumed: bool = True) -> None: @@ -233,7 +231,6 @@ def update_info_dict(self, info_dict: dict, resumed: bool = True) -> None: assert isinstance(info_dict, dict), ('`log_dict` must be a dict!, ' f'but got {type(info_dict)}') for key, value in info_dict.items(): - self._set_resumed_keys(key, resumed) self.update_info(key, value, resumed=resumed) def _set_resumed_keys(self, key: str, resumed: bool) -> None: