ARISE-Initiative / robosuite-benchmark

Benchmarking Repository for robosuite + SAC
53 stars 15 forks source link

ImportError: scipy 0.16+ is required for linear algebra #3

Closed Gaoee closed 3 years ago

Gaoee commented 3 years ago

When I tried to run training process, I got following error:

Traceback (most recent call last):
  File "scripts/train.py", line 131, in <module>
    run_experiment()
  File "scripts/train.py", line 104, in run_experiment
    experiment(variant, agent=args.agent)
  File "/home/exp/Codes/robosuite-benchmark-master/util/rlkit_utils.py", line 55, in experiment
    controller_configs=controller_config,
  File "/home/exp/anaconda3/envs/rb_bench/lib/python3.7/site-packages/robosuite/environments/base.py", line 37, in make
    return REGISTERED_ENVS[env_name](*args, **kwargs)
  File "/home/exp/anaconda3/envs/rb_bench/lib/python3.7/site-packages/robosuite/environments/lift.py", line 199, in __init__
    camera_depths=camera_depths,
  File "/home/exp/anaconda3/envs/rb_bench/lib/python3.7/site-packages/robosuite/environments/robot_env.py", line 188, in __init__
    hard_reset=hard_reset,
  File "/home/exp/anaconda3/envs/rb_bench/lib/python3.7/site-packages/robosuite/environments/base.py", line 131, in __init__
    self._reset_internal()
  File "/home/exp/anaconda3/envs/rb_bench/lib/python3.7/site-packages/robosuite/environments/lift.py", line 349, in _reset_internal
    super()._reset_internal()
  File "/home/exp/anaconda3/envs/rb_bench/lib/python3.7/site-packages/robosuite/environments/robot_env.py", line 291, in _reset_internal
    robot.reset(deterministic=self.deterministic_reset)
  File "/home/exp/anaconda3/envs/rb_bench/lib/python3.7/site-packages/robosuite/robots/single_arm.py", line 178, in reset
    super().reset(deterministic)
  File "/home/exp/anaconda3/envs/rb_bench/lib/python3.7/site-packages/robosuite/robots/robot.py", line 124, in reset
    self.base_ori = T.mat2quat(self.sim.data.get_body_xmat(self.robot_model.robot_base).reshape((3, 3)))
  File "/home/exp/anaconda3/envs/rb_bench/lib/python3.7/site-packages/numba/core/dispatcher.py", line 401, in _compile_for_args
    error_rewrite(e, 'typing')
  File "/home/exp/anaconda3/envs/rb_bench/lib/python3.7/site-packages/numba/core/dispatcher.py", line 344, in error_rewrite
    reraise(type(e), e, None)
  File "/home/exp/anaconda3/envs/rb_bench/lib/python3.7/site-packages/numba/core/utils.py", line 80, in reraise
    raise value.with_traceback(tb)
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Invalid use of Function(<function eigh at 0x7efd390fe4d0>) with argument(s) of type(s): (array(float32, 2d, C))
 * parameterized
In definition 0:
    ImportError: scipy 0.16+ is required for linear algebra
    raised from /home/exp/anaconda3/envs/rb_bench/lib/python3.7/site-packages/numba/np/linalg.py:64
In definition 1:
    ImportError: scipy 0.16+ is required for linear algebra
    raised from /home/exp/anaconda3/envs/rb_bench/lib/python3.7/site-packages/numba/np/linalg.py:64
This error is usually caused by passing an argument of a type that is unsupported by the named function.
[1] During: resolving callee type: Function(<function eigh at 0x7efd390fe4d0>)
[2] During: typing of call at /home/exp/anaconda3/envs/rb_bench/lib/python3.7/site-packages/robosuite/utils/transform_utils.py (348)

File "../../anaconda3/envs/rb_bench/lib/python3.7/site-packages/robosuite/utils/transform_utils.py", line 348:
def mat2quat(rmat):
    <source elided>
    # quaternion is Eigen vector of K that corresponds to largest eigenvalue
    w, V = np.linalg.eigh(K)
    ^

Is there any suggestion I can take to fix this error,THX.

cremebrule commented 3 years ago

Hi @Gaoee ,

Sorry I missed this. Can you verify what installation of scipy you have on your python interpreter? If you created a new environment from scratch using the providing .yml file then it should already have scipy=1.14

Gaoee commented 3 years ago

Thank you for your replay. I followed the .yml file to create my environment, and the scipy=1.14 was installed in my environment. But I still got the error message mentioned above. Now, I upgrade scipy to 1.5.3, and this error is fixed. But I don't know why.