Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Updated environment collection script #575

Merged
merged 2 commits into from
Nov 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions scripts/collect_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,31 @@
try:
import doctr
DOCTR_AVAILABLE = True
except (ImportError, NameError, AttributeError):
except (ImportError, NameError, AttributeError, OSError):
DOCTR_AVAILABLE = False

try:
import tensorflow as tf
TF_AVAILABLE = True
except (ImportError, NameError, AttributeError):
except (ImportError, NameError, AttributeError, OSError):
TF_AVAILABLE = False

try:
import torch
TORCH_AVAILABLE = True
except (ImportError, NameError, AttributeError):
except (ImportError, NameError, AttributeError, OSError):
TORCH_AVAILABLE = False

try:
import torchvision
TV_AVAILABLE = True
except (ImportError, NameError, AttributeError):
except (ImportError, NameError, AttributeError, OSError):
TV_AVAILABLE = False

try:
import cv2
CV2_AVAILABLE = True
except (ImportError, NameError, AttributeError):
except (ImportError, NameError, AttributeError, OSError):
CV2_AVAILABLE = False

PY3 = sys.version_info >= (3, 0)
Expand Down Expand Up @@ -146,7 +146,7 @@ def get_cudnn_version(run_lambda):
if len(out) == 0 or (rc != 1 and rc != 0):
lib = os.environ.get('CUDNN_LIBRARY')
if lib is not None and os.path.isfile(lib):
return os.path.realpath(l)
return os.path.realpath(lib)
return None
files = set()
for fn in out.split('\n'):
Expand Down Expand Up @@ -257,7 +257,7 @@ def get_env_info():
torch_version=torch_str,
torchvision_version=tv_str,
cv2_version=cv2_str,
python_version=f"{sys.version_info[0]}.{sys.version_info[1]}",
python_version=".".join(map(str, sys.version_info[:3])),
is_cuda_available_tf=tf_cuda_available_str,
is_cuda_available_torch=torch_cuda_available_str,
cuda_runtime_version=get_running_cuda_version(run_lambda),
Expand Down