2021-08-17 19:52:42 +08:00
|
|
|
# Copyright (c) OpenMMLab. All rights reserved.
|
2023-04-07 14:29:41 +08:00
|
|
|
import mmcv
|
2022-07-14 14:05:52 +08:00
|
|
|
from mmengine.utils import get_git_hash
|
2022-08-26 10:40:43 +08:00
|
|
|
from mmengine.utils.dl_utils import collect_env as collect_base_env
|
2020-05-21 21:21:43 +08:00
|
|
|
|
2023-02-17 11:31:08 +08:00
|
|
|
import mmpretrain
|
2020-05-21 21:21:43 +08:00
|
|
|
|
|
|
|
|
2023-04-07 14:29:41 +08:00
|
|
|
def collect_env(with_torch_comiling_info=False):
|
2020-12-01 14:24:08 +08:00
|
|
|
"""Collect the information of the running environments."""
|
|
|
|
env_info = collect_base_env()
|
2023-04-07 14:29:41 +08:00
|
|
|
env_info['MMCV'] = mmcv.__version__
|
|
|
|
if not with_torch_comiling_info:
|
|
|
|
env_info.pop('PyTorch compiling details')
|
|
|
|
env_info['MMPreTrain'] = mmpretrain.__version__ + '+' + get_git_hash()[:7]
|
2020-05-21 21:21:43 +08:00
|
|
|
return env_info
|