diff --git a/docs/install.md b/docs/install.md index c4880701a..ad9b8fb31 100644 --- a/docs/install.md +++ b/docs/install.md @@ -81,8 +81,8 @@ pip install -v -e . # or "python setup.py develop" | MMDetection3D version | MMDetection version | MMCV version | |:-------------------:|:-------------------:|:-------------------:| -| master | mmdet>=2.4.0 | mmcv-full>=1.1.1, <=1.2| -| 0.6.0 | mmdet>=2.4.0 | mmcv-full>=1.1.1, <=1.2| +| master | mmdet>=2.4.0 | mmcv-full>=1.1.3, <=1.2| +| 0.6.0 | mmdet>=2.4.0 | mmcv-full>=1.1.3, <=1.2| | 0.5.0 | 2.3.0 | mmcv-full==1.0.5| diff --git a/mmdet3d/__init__.py b/mmdet3d/__init__.py index 1c4f7e8fc..20207788b 100644 --- a/mmdet3d/__init__.py +++ b/mmdet3d/__init__.py @@ -1,3 +1,38 @@ +import mmcv + +import mmdet from .version import __version__, short_version + +def digit_version(version_str): + digit_version = [] + for x in version_str.split('.'): + if x.isdigit(): + digit_version.append(int(x)) + elif x.find('rc') != -1: + patch_version = x.split('rc') + digit_version.append(int(patch_version[0]) - 1) + digit_version.append(int(patch_version[1])) + return digit_version + + +mmcv_minimum_version = '1.1.3' +mmdet_maximum_version = '1.2' +mmcv_version = digit_version(mmcv.__version__) + + +assert (mmcv_version >= digit_version(mmcv_minimum_version) + and mmcv_version <= digit_version(mmdet_maximum_version)), \ + f'MMCV=={mmcv.__version__} is used but incompatible. ' \ + f'Please install mmcv>={mmcv_minimum_version}, <={mmdet_maximum_version}.' + +mmdet_minimum_version = '2.4.0' +mmdet_maximum_version = '2.4.0' +mmdet_version = digit_version(mmdet.__version__) +assert (mmdet_version >= digit_version(mmdet_minimum_version) + and mmdet_version <= digit_version(mmdet_maximum_version)), \ + f'MMDET=={mmdet.__version__} is used but incompatible. ' \ + f'Please install mmdet>={mmdet_minimum_version}, ' \ + f'<={mmdet_maximum_version}.' + __all__ = ['__version__', 'short_version']