ARISE-Initiative / robosuite

robosuite: A Modular Simulation Framework and Benchmark for Robot Learning
https://robosuite.ai
Other
1.24k stars 397 forks source link

Running into error when making environment #193

Closed abhihjoshi closed 3 years ago

abhihjoshi commented 3 years ago

I am currently trying to make the TwoArmLift environment, however, I am running to the following error when doing so:

Traceback (most recent call last): File "C:\Abhi\Python Projects\robosuite-dev\robosuite\renderers\visii\visii_render_wrapper.py", line 369, in control_freq=10, File "c:\abhi\python projects\robosuite\robosuite\environments\base.py", line 41, in make return REGISTERED_ENVS[env_name](*args, **kwargs) File "c:\abhi\python projects\robosuite\robosuite\environments\manipulation\two_arm_lift.py", line 200, in init camera_depths=camera_depths, File "c:\abhi\python projects\robosuite\robosuite\environments\manipulation\manipulation_env.py", line 168, in init robot_configs=robot_configs, File "c:\abhi\python projects\robosuite\robosuite\environments\robot_env.py", line 196, in init hard_reset=hard_reset, File "c:\abhi\python projects\robosuite\robosuite\environments\base.py", line 138, in init self._load_model() File "c:\abhi\python projects\robosuite\robosuite\environments\manipulation\two_arm_lift.py", line 299, in _load_model robot.robot_model.set_base_ori(rot) File "c:\abhi\python projects\robosuite\robosuite\models\robots\robot_model.py", line 87, in set_base_ori rot = mat2quat(euler2mat(rot))[[3,0,1,2]] TypeError: expected dtype object, got 'numpy.dtype[float32]'

It seems that the method euler2mat is correctly returning a 3x3 matrix, but when it goes to pass it into the mat2quat function, it gives this error. I also tried to run with different environments, but I land into similar issues. Does anybody know why this might be happening and how I can go about fixing it?

amandlek commented 3 years ago

thanks for bringing this up - can you please make a minimal test script to reproduce the issue on the latest master branch commit?

abhihjoshi commented 3 years ago
import numpy as np
import robosuite as suite

# create environment instance
env = suite.make(
    "TwoArmLift",
    robots = ["Sawyer", "Panda"],
    reward_shaping=True,
    has_renderer=True,            # no on-screen renderer
    has_offscreen_renderer=False, # no off-screen renderer
    ignore_done=True,
    use_object_obs=True,          # use object-centric feature
    use_camera_obs=False,         # no camera observations
    control_freq=10,
)

# reset the environment
env.reset()

for i in range(200):
    action = np.random.randn(16)  # sample random action
    obs, reward, done, info = env.step(action)  # take action in the environment
    env.render()  # render on display
abhihjoshi commented 3 years ago

I think the issue stems from a compatibility issue with numpy. Originally, I had v1.20 for numpy, but after reverting it back to v1.19.5, the program works fine. I am not sure why this is happening though.

cremebrule commented 3 years ago

What version numba are you using? This thread suggests that numba may have something to do with this.

A quick sanity check would be to set ENABLE_NUMBA=False in robosuite/utils/macros.py and see if the problem goes away.

abhihjoshi commented 3 years ago

Yes, now with numpy v1.20.1 and after setting ENABLE_NUMBA=False, the program works.

cremebrule commented 3 years ago

Can you upgrade to the newest numba and try seeing if the program still crashes when ENABLE_NUMBA=True?

abhihjoshi commented 3 years ago

Yes, the program works after upgrading numba with ENABLE_NUMBA=True.