AttributeError: module 'numpy' has no attribute 'float'

Hi, I am new to IsaacGym. I can run joint_monkey.py but I encounter the error in the title when I use IsaacGymEnvs. Below are the information of my implementation

Code I run:

import isaacgym
import isaacgymenvs
import torch

num_envs = 2000
envs = isaacgymenvs.make(
    seed=0,
    task="Ant",
    num_envs=num_envs,
    sim_device="cuda:0",
    rl_device="cuda:0",
)

print("Observation space is", envs.observation_space)
print("Action space is", envs.action_space)
obs = envs.reset()
for _ in range(20):
    random_actions = 2.0 * torch.rand((num_envs,) + envs.action_space.shape, device = 'cuda:0') - 1.0
    envs.step(random_actions)

I got the error message in the title for this line ‘envs = isaacgymenvs.make(’

my numpy version: 1.24.4

my nvidia-smi information:
NVIDIA-SMI 535.113.01 Driver Version: 535.113.01 CUDA Version: 12.2

my graphic card: 3060ti

Can someone suggest me possible ways to resolve this issue?

Either (a) manually downgrade NumPy via pip install "numpy<1.20" or (b) manually edit the file torch_utils.py to replace references to np.float with float. Neither option fundamentally solves the problem of IsaacGym using deprecated code, but AFAIK there’s no news on Preview 5 or further releases to address this.

Best bet to future-proof your project is to move onto Omniverse/IsaacSim, according to words on the street :)

1 Like