[Enhancement] Install mmcv-full by fuzzy matching (#20)

* [Enhancement] Install mmcv-full by fuzzy matching

* modify according to comment
This commit is contained in:
Zaida Zhou 2021-05-24 22:30:50 +08:00 committed by GitHub
parent 855439eb2b
commit f81e1cc498
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -236,6 +236,14 @@ def infer_find_url(package: str) -> str:
find_url = ''
if package in WHEEL_URL:
torch_v, cuda_v = get_torch_cuda_version()
# In order to avoid builiding mmcv-full from source, we ignore the
# difference among micro version because there are usually no big
# changes among micro version. For example, the mmcv-full built in
# pytorch 1.8.0 also works on 1.8.1 or other versions.
major, minor, *_ = torch_v.split('.')
torch_v = '.'.join([major, minor, '0'])
if cuda_v.isdigit():
cuda_v = f'cu{cuda_v}'
find_url = WHEEL_URL[package].format(