[Fix] Temporarily fix collect_env raises errors and stops programs (#944)
* temporarily fix `collect_env` raise errors and stops programs * remove the final catch blockpull/948/head
parent
b14c179fad
commit
e271454527
|
@ -95,6 +95,7 @@ def collect_env():
|
|||
# Check C++ Compiler.
|
||||
# For Unix-like, sysconfig has 'CC' variable like 'gcc -pthread ...',
|
||||
# indicating the compiler used, we use this to get the compiler name
|
||||
import io
|
||||
import sysconfig
|
||||
cc = sysconfig.get_config_var('CC')
|
||||
if cc:
|
||||
|
@ -119,6 +120,12 @@ def collect_env():
|
|||
env_info['GCC'] = 'n/a'
|
||||
except (subprocess.CalledProcessError, errors.DistutilsPlatformError):
|
||||
env_info['GCC'] = 'n/a'
|
||||
except io.UnsupportedOperation as e:
|
||||
# JupyterLab on Windows changes sys.stdout, which has no `fileno` attr
|
||||
# Refer to: https://github.com/open-mmlab/mmengine/issues/931
|
||||
# TODO: find a solution to get compiler info in Windows JupyterLab,
|
||||
# while preserving backward-compatibility in other systems.
|
||||
env_info['MSVC'] = f'n/a, reason: {str(e)}'
|
||||
|
||||
env_info['PyTorch'] = torch.__version__
|
||||
env_info['PyTorch compiling details'] = get_build_config()
|
||||
|
|
Loading…
Reference in New Issue