collect_env.py 671 Bytes
Newer Older
dingchang's avatar
dingchang committed
1
# Copyright (c) OpenMMLab. All rights reserved.
2
import mmdet
3
4
from mmengine.utils import get_git_hash
from mmengine.utils.dl_utils import collect_env as collect_base_env
zhangwenwei's avatar
zhangwenwei committed
5

6
import mmdet3d
zhangwenwei's avatar
zhangwenwei committed
7
8
9


def collect_env():
10
11
    """Collect the information of the running environments."""
    env_info = collect_base_env()
12
13
    env_info['MMDetection'] = mmdet.__version__
    env_info['MMDetection3D'] = mmdet3d.__version__ + '+' + get_git_hash()[:7]
zhangshilong's avatar
zhangshilong committed
14
    from mmdet3d.models.layers.spconv import IS_SPCONV2_AVAILABLE
VVsssssk's avatar
VVsssssk committed
15
    env_info['spconv2.0'] = IS_SPCONV2_AVAILABLE
zhangshilong's avatar
zhangshilong committed
16

zhangwenwei's avatar
zhangwenwei committed
17
18
19
20
21
    return env_info


if __name__ == '__main__':
    for name, val in collect_env().items():
22
        print(f'{name}: {val}')