| 54 | |
| 55 | |
| 56 | def mmcv_links(): |
| 57 | try: |
| 58 | import torch |
| 59 | except ImportError as e: |
| 60 | print('Pytorch is not installed.') |
| 61 | raise e |
| 62 | cuda_version = torch.version.cuda |
| 63 | if cuda_version is None: |
| 64 | print('Pytorch is cpu only.') |
| 65 | raise NotImplementedError |
| 66 | |
| 67 | cuda_version_str = torch.version.cuda.replace('.', '') |
| 68 | pyt_version = torch.__version__.split('+')[0].split('.') |
| 69 | pyt_version_mmcv = pyt_version[0] + '.' + pyt_version[1] |
| 70 | mmcv_links = f'https://download.openmmlab.com/mmcv/dist/cu{cuda_version_str}/torch{pyt_version_mmcv}/index.html' # noqa: E501 |
| 71 | return mmcv_links |
| 72 | |
| 73 | |
| 74 | def install_package(line): |