From 0a7be2ecb1abdf7ba3446f68a4328955edc837a3 Mon Sep 17 00:00:00 2001 From: zhangshilong Date: Fri, 19 Mar 2021 00:08:23 +0800 Subject: [PATCH] add more detail of warning in basemodule --- mmcv/runner/base_module.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmcv/runner/base_module.py b/mmcv/runner/base_module.py index 4cefddce03..418caa1a19 100644 --- a/mmcv/runner/base_module.py +++ b/mmcv/runner/base_module.py @@ -47,8 +47,8 @@ def init_weight(self): module.init_weight() self._is_init = True else: - warnings.warn('This module has bee initialized, \ - please call initialize(module, init_cfg) to reinitialize it') + warnings.warn(f'init_weight of {self.__class__.__name__} has ' + f'been called more than once.') def __repr__(self): s = super().__repr__()