isaac-sim / IsaacGymEnvs

Isaac Gym Reinforcement Learning Environments
Other
1.79k stars 392 forks source link

Can't create 2 envs consecutively in the same workspace #159

Open vmoens opened 11 months ago

vmoens commented 11 months ago

Creating 2 identical or different envs consecutively fails:

envs = isaacgymenvs.make(
        seed=0,
        task="Ant",
        num_envs=num_envs,
        sim_device="cuda:0",
        rl_device="cuda:0",headless=True,
)
print("\n\n\nenv0\n\n")
envs = isaacgymenvs.make(
        seed=0,
        task="Ant",
        num_envs=num_envs,
        sim_device="cuda:0",
        rl_device="cuda:0",headless=True,
)  # fails
print("\n\n\nenv1\n\n")

I get errors like this one:

  File "/fsx/users/vmoens/work/rl/torchrl/envs/libs/isaacgym.py", line 37, in _make_envs
    envs = isaacgymenvs.make(
  File "/fsx/users/vmoens/work/isaac/IsaacGymEnvs/isaacgymenvs/__init__.py", line 55, in make
    return create_rlgpu_env()
  File "/fsx/users/vmoens/work/isaac/IsaacGymEnvs/isaacgymenvs/utils/rlgames_utils.py", line 113, in create_rlgpu_env
    env = isaacgym_task_map[task_name](
  File "/fsx/users/vmoens/work/isaac/IsaacGymEnvs/isaacgymenvs/tasks/ant.py", line 94, in __init__
    self.dof_pos = self.dof_state.view(self.num_envs, self.num_dof, 2)[..., 0]
RuntimeError: shape '[10, 8, 2]' is invalid for input of size 480

Where the size of the tensor seems to be N times greater than in should. Is there a global variable changed somewhere?