Skip to content
This repository has been archived by the owner on Feb 13, 2025. It is now read-only.

Printing the gym version in the collect_env script #30

Merged
merged 1 commit into from
Nov 2, 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
12 changes: 11 additions & 1 deletion minihack/scripts/collect_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
try:
import nle
import minihack
import gym

NLE_AVAILABLE = True
MINIHACK_AVAILABLE = True
GYM_AVAILABLE = True
except (ImportError, NameError, AttributeError):
NLE_AVAILABLE = False
MINIHACK_AVAILABLE = False

GYM_AVAILABLE = True
try:
import torch

Expand All @@ -38,6 +40,7 @@
[
"minihack_version",
"nle_version",
"gym_version",
"torch_version",
"is_debug_build",
"cuda_compiled_version",
Expand Down Expand Up @@ -301,6 +304,11 @@ def get_env_info():
else:
minihack_version = "N/A"

if GYM_AVAILABLE:
gym_version = gym.__version__
else:
gym_version = "N/A"

if TORCH_AVAILABLE:
torch_version_str = torch.__version__
torch_debug_mode_str = torch.version.debug
Expand All @@ -314,6 +322,7 @@ def get_env_info():
return SystemEnv(
minihack_version=minihack_version,
nle_version=nle_version,
gym_version=gym_version,
torch_version=torch_version_str,
is_debug_build=torch_debug_mode_str,
python_version="{}.{}".format(
Expand All @@ -337,6 +346,7 @@ def get_env_info():
env_info_fmt = """
MiniHack version: {minihack_version}
NLE version: {nle_version}
Gym version: {gym_version}
PyTorch version: {torch_version}
Is debug build: {is_debug_build}
CUDA used to build PyTorch: {cuda_compiled_version}
Expand Down