diff --git a/mmseg/__init__.py b/mmseg/__init__.py index 5fcb84e8c4..56982cf156 100644 --- a/mmseg/__init__.py +++ b/mmseg/__init__.py @@ -58,17 +58,23 @@ def digit_version(version_str: str, length: int = 4): mmcv_version = digit_version(mmcv.__version__) -assert (mmcv_min_version <= mmcv_version < mmcv_max_version), \ +assert (mmcv_version >= mmcv_min_version), \ f'MMCV=={mmcv.__version__} is used but incompatible. ' \ - f'Please install mmcv>=2.0.0rc4.' + f'Please install mmcv>={MMCV_MIN}.' + +assert (mmcv_version <= mmcv_max_version), \ + f'MMCV=={mmcv.__version__} is used but incompatible. ' \ + f'Please install mmcv<{MMCV_MAX}.' mmengine_min_version = digit_version(MMENGINE_MIN) mmengine_max_version = digit_version(MMENGINE_MAX) mmengine_version = digit_version(mmengine.__version__) -assert (mmengine_min_version <= mmengine_version < mmengine_max_version), \ +assert (mmengine_version >= mmengine_min_version), \ f'MMEngine=={mmengine.__version__} is used but incompatible. ' \ - f'Please install mmengine>={mmengine_min_version}, '\ - f'<{mmengine_max_version}.' + f'Please install mmengine>={MMENGINE_MIN}.' +assert (mmengine_version < mmengine_max_version), \ + f'MMEngine=={mmengine.__version__} is used but incompatible. ' \ + f'Please install mmengine<{MMENGINE_MAX}.' __all__ = ['__version__', 'version_info', 'digit_version']