From dcb5695f1d8919301f7c92a9c710c86d048e64fa Mon Sep 17 00:00:00 2001 From: wangtao <865471687@qq.com> Date: Wed, 23 Mar 2022 15:20:33 +0800 Subject: [PATCH 1/2] Fix the bug that Maze2D and AntMaze cannot be used in windows The method "mujoco_py.load_model_from_path(fullpath)" can't load the file because it was opened but not closed when the temporary file was generated. So we need to close the file manually before calling this method. --- d4rl/locomotion/maze_env.py | 3 ++- d4rl/pointmaze/dynamic_mjc.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/d4rl/locomotion/maze_env.py b/d4rl/locomotion/maze_env.py index c6010f2b..b1dc5c2c 100644 --- a/d4rl/locomotion/maze_env.py +++ b/d4rl/locomotion/maze_env.py @@ -198,8 +198,9 @@ def __init__( torso = tree.find(".//body[@name='torso']") geoms = torso.findall(".//geom") - _, file_path = tempfile.mkstemp(text=True, suffix='.xml') + fd, file_path = tempfile.mkstemp(text=True, suffix='.xml') tree.write(file_path) + os.close(fd) self.LOCOMOTION_ENV.__init__(self, *args, file_path=file_path, non_zero_reset=non_zero_reset, reward_type=reward_type, **kwargs) diff --git a/d4rl/pointmaze/dynamic_mjc.py b/d4rl/pointmaze/dynamic_mjc.py index 657554d7..1825cbf9 100644 --- a/d4rl/pointmaze/dynamic_mjc.py +++ b/d4rl/pointmaze/dynamic_mjc.py @@ -51,9 +51,10 @@ def asfile(self): with model.asfile() as f: print f.read() # prints a dump of the model """ - with tempfile.NamedTemporaryFile(mode='w+', suffix='.xml', delete=True) as f: + with tempfile.NamedTemporaryFile(mode='w+', suffix='.xml', delete=False) as f: self.root.write(f) f.seek(0) + f.close() yield f def open(self): From d7c988d329679597909f679f83dbef40b58365a5 Mon Sep 17 00:00:00 2001 From: wangtao <865471687@qq.com> Date: Sun, 10 Apr 2022 15:57:30 +0800 Subject: [PATCH 2/2] modify setup.py specify the version --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index c0a23936..55fe7642 100644 --- a/setup.py +++ b/setup.py @@ -6,16 +6,16 @@ setup( name='d4rl', version='1.1', - install_requires=['gym', + install_requires=['gym==0.19.0', 'numpy', - 'mujoco_py', + 'mujoco_py==2.0.2.8', 'pybullet', 'h5py', 'termcolor', # adept_envs dependency 'click', # adept_envs dependency 'dm_control' if 'macOS' in platform() else - 'dm_control @ git+git://github.com/deepmind/dm_control@master#egg=dm_control', - 'mjrl @ git+git://github.com/aravindr93/mjrl@master#egg=mjrl'], + 'dm_control @ git+https://github.com/deepmind/dm_control@644d9e0047f68b35a6f8b79e5e8493e2910563af', + 'mjrl @ git+https://github.com/aravindr93/mjrl@master#egg=mjrl'], packages=find_packages(), package_data={'d4rl': ['locomotion/assets/*', 'hand_manipulation_suite/assets/*',