Error in Reinforcement Learning example

I got the error below while following the tutorial in documentation.

When I run python --task Cartpole or python --task Cartpole, I receive the error below.

$ python --task Cartpole
Importing module 'gym_37' (/home/donguk/Downloads/isaacgym/python/isaacgym/_bindings/linux-x86_64/
Setting GYM_USD_PLUG_INFO_PATH to /home/donguk/Downloads/isaacgym/python/isaacgym/_bindings/linux-x86_64/usd/plugInfo.json
PyTorch version 1.9.0+cu111
Device count 1
Using /home/donguk/.cache/torch_extensions as PyTorch extensions root...
Emitting ninja build file /home/donguk/.cache/torch_extensions/gymtorch/
Building extension module gymtorch...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
ninja: no work to do.
Loading extension module gymtorch...
Traceback (most recent call last):
  File "", line 12, in <module>
    from utils.parse_task import parse_task
  File "/home/donguk/Downloads/isaacgym/python/rlgpu/utils/", line 17, in <module>
    from rlgpu.tasks.anymal import Anymal
  File "/home/donguk/Downloads/isaacgym/python/rlgpu/tasks/", line 18, in <module>
    from torch.tensor import Tensor
ModuleNotFoundError: No module named 'torch.tensor'

It seems that torch version mismatch is the problem. though…
As you can see in the log, I have installed pytorch 1.90, which is required version for isaacgym.

Would you kindly help to handle this problem?

Hi @ehddnr7471

I use torch 1.8.1 to run Isaac Gym, and everything goes well

pip install torch==1.8.1

Another solution is to change the code in

--- from torch.tensor import Tensor
+++ Tensor = torch.Tensor

Installing torch==1.8.1 did not work for me as the installed version of torchvision requires torch 1.9.0. Changing the code as suggested by @ehddnr7471 worked for me, but I ran into another problem:

ModuleNotFoundError: No module named 'tensorboard'

which was fixed with pip install tensorboard. Then I ran into a CUDA problem which I assume is unrelated to this issue.

1 Like