lorenmt / minimal-isaac-gym

A Minimal Example of Isaac Gym with DQN and PPO.
95 stars 15 forks source link

Broadcast error (`cannot broadcast to a lower rank tensor`) #1

Closed Theo-Cheynel closed 2 years ago

Theo-Cheynel commented 2 years ago

I have a working install of IsaagGym, IsaacGymEnvs and rl-games, and I just followed the steps in this repository's README to get it to run, however I get the following issue :

Traceback (most recent call last):
  File "trainer.py", line 35, in <module>
    policy.run()
  File "/home/theo/Documents/minimal-isaac-gym/dqn.py", line 105, in run
    self.env.step(action)
  File "/home/theo/Documents/minimal-isaac-gym/env.py", line 199, in step
    self.get_reward()
  File "/home/theo/Documents/minimal-isaac-gym/env.py", line 139, in get_reward
    self.max_episode_length)
RuntimeError: MALFORMED INPUT: Cannot broadcast to a lower rank tensor

Does anyone know whether this is a common issue ?

lorenmt commented 2 years ago

This is super weird...Did you change the flags in the trainer?

Theo-Cheynel commented 2 years ago

No, I just ran the trainer as is... The error comes from the compute_cartpole_reward, I removed the JIT decorator and now it's working properly

Theo-Cheynel commented 2 years ago

(also, thanks a ton for this repository, I'm learning IsaacGym and this minimal example is just a perfect way to get started)

lorenmt commented 2 years ago

I see. I assume the problem might be from the different Pytorch versions.

Theo-Cheynel commented 2 years ago

Yes, that's the most likely. I'll close the issue but I'll update it if ever I find what went wrong in the python environment