Open lsj1111 opened 8 months ago
mmcv 2.0.1
from mmcv.utils import (IS_NPU_AVAILABLE, _BatchNorm, )
In the mmcv1.x , the method of _BatchNorm is in the mmcv.utils,but now in the mmcv 2.x ,it does not exist,and i can't find it in the mmengine
ImportError: cannot import name '_BatchNorm' from 'mmcv.utils' (D:\Tool\Anaconda\Anaconda\envs\openmmlab\lib\site-packages\mmcv\utils__init__.py)
I found it in parrots_wrapper.py
try this: from torch.nn.modules.batchnorm import _BatchNorm
Prerequisite
Environment
mmcv 2.0.1
Reproduces the problem - code sample
from mmcv.utils import (IS_NPU_AVAILABLE, _BatchNorm, )
Reproduces the problem - command or script
In the mmcv1.x , the method of _BatchNorm is in the mmcv.utils,but now in the mmcv 2.x ,it does not exist,and i can't find it in the mmengine
Reproduces the problem - error message
ImportError: cannot import name '_BatchNorm' from 'mmcv.utils' (D:\Tool\Anaconda\Anaconda\envs\openmmlab\lib\site-packages\mmcv\utils__init__.py)
Additional information
In the mmcv1.x , the method of _BatchNorm is in the mmcv.utils,but now in the mmcv 2.x ,it does not exist,and i can't find it in the mmengine