AI4Finance-Foundation / ElegantRL

Massively Parallel Deep Reinforcement Learning. 🔥
https://ai4finance.org
Other
3.62k stars 832 forks source link

Can't run AnymalTerrain environment with Isaac Gym #116

Closed hmomin closed 2 years ago

hmomin commented 2 years ago

When I try to run the AnymalTerrain environment on Isaac Gym using examples/tutorial_Isaac_Gym.py, I receive the following error:

Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/home/momin/Documents/GitHub/ElegantRL/elegantrl/run.py", line 161, in run
    trajectory = agent.explore_env(env, target_step)
  File "/home/momin/Documents/GitHub/ElegantRL/elegantrl/agent.py", line 678, in explore_vec_env
    return self.convert_trajectory(traj_list, last_done)  # traj_list
  File "/home/momin/Documents/GitHub/ElegantRL/elegantrl/agent.py", line 118, in convert_trajectory
    buf_items[2] = ((1 - torch.stack(buf_items[2])) * self.gamma).unsqueeze(2)
  File "/home/momin/.local/lib/python3.8/site-packages/torch/_tensor.py", line 30, in wrapped
    return f(*args, **kwargs)
  File "/home/momin/.local/lib/python3.8/site-packages/torch/_tensor.py", line 548, in __rsub__
    return _C._VariableFunctions.rsub(self, other)
RuntimeError: Subtraction, the `-` operator, with a bool tensor is not supported. If you are trying to invert a mask, use the `~` or `logical_not()` operator instead.

I'll look into this.

hmomin commented 2 years ago

This has been fixed in commit 93e2e45.