ImportError: cannot import name 'revert_sync_batchnorm' from 'mmcv.cnn.utils'
Hello~ When I run tools/train.py, it shows error:
File "tools/train.py", line 12, in <module>
from mmcv.cnn.utils import revert_sync_batchnorm
ImportError: cannot import name 'revert_sync_batchnorm' from 'mmcv.cnn.utils' (/xxxpy3.8/lib/python3.8/site-packages/mmcv/cnn/utils/__init__.py)
My envs are:
python3.8
torch==1.13.0
mmcv==2.0.0
How to fix it ? Looking forward to your reply.
I have the same error.
same error
try:
mim uninstall mmcv
mim install mmcv-full
mim install mmcv==1.6.0
Did anyone find a solution for this error? Seems like the function is now present in mmengine.model
from mmengine.model import revert_sync_batchnorm
same error
try lower version of mmcv
in mmcv2.0.0 and higher version this error happens ,but when i install lower version,it turns out to :
Traceback (most recent call last):
File "tools/train-deeplabv3plus.py", line 16, in
AssertionError: MMCV==1.7.2 is used but incompatible. Please install mmcv>=2.0.0rc4.
really confused,i think the train.py code should be edited