D4RL icon indicating copy to clipboard operation
D4RL copied to clipboard

Step-by-step instalation tutorial?

Open ivanvoid opened this issue 2 years ago • 2 comments

Hi, I assume that this project was made to help the RL community develop better algorithms for solving offline RL problems. I think that time should be spent exactly on model development and not on figuring out how to install and use provided env software. So I assembled a little step-by-step guide on how to install D4RL. But I hope that maintainers can update wiki or readme file, thank you. (I can contribute this writeup with more explanations, just tell me where you want it)

This is link to my attempt to set up everything

PS: I am writing here, not because I wrote how to set everything up, but because I failed to do so. PSS: for me attempt to run test d4rl script crashes with error:

Traceback (most recent call last):
  File "/home/ivan/Projects/offlineRL2/test_env.py", line 5, in <module>
    env = gym.make('maze2d-umaze-v1')
  File "/home/ivan/miniconda3/envs/offlineRL/lib/python3.9/site-packages/gym/envs/registration.py", line 597, in make
    env = cls(**_kwargs)
  File "/home/ivan/Projects/offlineRL2/d4rl/d4rl/pointmaze/maze_model.py", line 175, in __init__
    mujoco_env.MujocoEnv.__init__(self, model_path=f.name, frame_skip=1)
  File "/home/ivan/miniconda3/envs/offlineRL/lib/python3.9/site-packages/gym/envs/mujoco/mujoco_env.py", line 97, in __init__
    observation, _reward, done, _info = self.step(action)
  File "/home/ivan/Projects/offlineRL2/d4rl/d4rl/pointmaze/maze_model.py", line 192, in step
    self.clip_velocity()
  File "/home/ivan/Projects/offlineRL2/d4rl/d4rl/pointmaze/maze_model.py", line 222, in clip_velocity
    qvel = np.clip(self.sim.data.qvel, -5.0, 5.0)
AttributeError: 'MazeEnv' object has no attribute 'sim'

ivanvoid avatar May 30 '22 08:05 ivanvoid

hi, when i test the code, I encountered the following bug. Do u know how to solve it? thanks !!! Traceback (most recent call last): File "D:/PyProject/BCQ-master/text.py", line 5, in <module> env = gym.make('maze2d-umaze-v1') File "D:\Program Files\Anaconda3\envs\mujoco\lib\site-packages\gym\envs\registration.py", line 597, in make env = cls(**_kwargs) File "d:\d4rl\d4rl\pointmaze\maze_model.py", line 175, in __init__ mujoco_env.MujocoEnv.__init__(self, model_path=f.name, frame_skip=1) File "D:\Program Files\Anaconda3\envs\mujoco\lib\site-packages\gym\envs\mujoco\mujoco_env.py", line 78, in __init__ self.model = self._mujoco_bindings.MjModel.from_xml_path(fullpath) ValueError: XML parse error 3: Error=XML_ERROR_FILE_NOT_FOUND ErrorID=3 (0x3) Line number=0: filename=C:\Users\86137\AppData\Local\Temp\tmpfvbqdq7w.xml

huangzizhen avatar Jun 06 '22 13:06 huangzizhen

I managed to fix this error @ivanvoid by modifying the gym version:

  1. pip uninstall gym
  2. pip install gym==0.23.1

agiachris avatar Jun 07 '22 05:06 agiachris