From f81e1cc4984a7f7013013d25ffc1edad7a8d1dd5 Mon Sep 17 00:00:00 2001 From: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com> Date: Mon, 24 May 2021 22:30:50 +0800 Subject: [PATCH] [Enhancement] Install mmcv-full by fuzzy matching (#20) * [Enhancement] Install mmcv-full by fuzzy matching * modify according to comment --- mim/commands/install.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mim/commands/install.py b/mim/commands/install.py index 8822385..24c602e 100644 --- a/mim/commands/install.py +++ b/mim/commands/install.py @@ -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(