Skip to content

ConcentricTubeRobot Example Error #58

@katahar

Description

@katahar

Current configuration:
Ubuntu 20.04
Sofa v23.06.00 (From Binary)
Python 3.8.10

When running example (python test_env.py -e concentrictuberobot-v0 -ep 100 -s 100), simulation runs successfully, but when throws this error when training (python rl.py -e concentrictuberobot-v0 -a DQN)

  [SofaRuntime] UFuncTypeError: ufunc 'subtract' did not contain a loop with signature matching types (dtype('<U1'), dtype('float64')) -> None
Traceback (most recent call last):
  File "rl.py", line 114, in <module>
    agent.fit(total_timesteps)
  File "/home/ubuntu20_sofa/SofaGym/agents/SB3Agent.py", line 309, in fit
    self.model.learn(total_timesteps=total_timesteps, reset_num_timesteps=False,
  File "/home/ubuntu20_sofa/.local/lib/python3.8/site-packages/stable_baselines3/dqn/dqn.py", line 265, in learn
    return super().learn(
  File "/home/ubuntu20_sofa/.local/lib/python3.8/site-packages/stable_baselines3/common/off_policy_algorithm.py", line 334, in learn
    rollout = self.collect_rollouts(
  File "/home/ubuntu20_sofa/.local/lib/python3.8/site-packages/stable_baselines3/common/off_policy_algorithm.py", line 567, in collect_rollouts
    new_obs, rewards, dones, infos = env.step(actions)
  File "/home/ubuntu20_sofa/.local/lib/python3.8/site-packages/stable_baselines3/common/vec_env/base_vec_env.py", line 163, in step
    return self.step_wait()
  File "/home/ubuntu20_sofa/.local/lib/python3.8/site-packages/stable_baselines3/common/vec_env/vec_monitor.py", line 76, in step_wait
    obs, rewards, dones, infos = self.venv.step_wait()
  File "/home/ubuntu20_sofa/.local/lib/python3.8/site-packages/stable_baselines3/common/vec_env/vec_normalize.py", line 197, in step_wait
    infos[idx]["terminal_observation"] = self.normalize_obs(infos[idx]["terminal_observation"])
  File "/home/ubuntu20_sofa/.local/lib/python3.8/site-packages/stable_baselines3/common/vec_env/vec_normalize.py", line 240, in normalize_obs
    obs_ = self._normalize_obs(obs, self.obs_rms).astype(np.float32)
  File "/home/ubuntu20_sofa/.local/lib/python3.8/site-packages/stable_baselines3/common/vec_env/vec_normalize.py", line 216, in _normalize_obs
    return np.clip((obs - obs_rms.mean) / np.sqrt(obs_rms.var + self.epsilon), -self.clip_obs, self.clip_obs)

Any advice here? I'm pretty sure that I have installed all of the dependencies correctly according to the readme, and this issue is confirmed on multiple installs/machines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions