Closed XilunZhangRobo closed 1 month ago
Hey @XilunZhangRobo,
Thanks for posting. I'm not overly familiar with the RL side (and in particular the vectorized envs), but I'll take a look. So I can recreate the issue can you post:
pip list
Thanks.
I am going to close this due to inactivity. I can look into this more if there is renewed interest.
Hi Thanks for the amazing work! I am currently running the rarl controller for quadrotor control, however, when I tried to increase the n_workers above 1, it raises an error: AttributeError: 'list' object has no attribute 'tolist'.
Also I have noticed that Here(https://github.com/utiasDSL/safe-control-gym/blob/c8c5c75f8a417e98777a28f02aa0d3720d238c4d/safe_control_gym/envs/env_wrappers/vectorized_env/subproc_vec_env.py#L113C9-L113C76), the function has two outputs, but in the set_attr , it changes to three.
Thanks for the help!
Here is the full error message: File "/safe-control-gym/safe_control_gym/experiments/train_rl_controller.py", line 123, in
train()
File "/safe-control-gym/safe_control_gym/experiments/train_rl_controller.py", line 54, in train
ctrl = make(config.algo,
File "/safe-control-gym/safe_control_gym/utils/registration.py", line 125, in make
return registry.make(idx, *args, kwargs)
File "safe-control-gym/safe_control_gym/utils/registration.py", line 88, in make
obj = spec.make(*args, *kwargs)
File "/safe-control-gym/safe_control_gym/utils/registration.py", line 69, in make
obj = cls(args, kwargs)
File "/safe-control-gym/safe_control_gym/controllers/rarl/rarl.py", line 70, in init
self.adv_obs_space = self.env.get_attr('adversary_observation_space')[0]
File "/safe-control-gym/safe_control_gym/envs/env_wrappers/vectorized_env/vec_env.py", line 189, in get_attr
return self.venv.get_attr(attr_name, indices)
File "/safe-control-gym/safe_control_gym/envs/env_wrappers/vectorized_env/subproc_vec_env.py", line 113, in get_attr
target_remotes, remote_env_indices = self._get_target_envs(indices)
File "/safe-control-gym/safe_control_gym/envs/env_wrappers/vectorized_env/subproc_vec_env.py", line 182, in _get_target_envs
remote_env_indices = remote_env_indices.tolist()
AttributeError: 'list' object has no attribute 'tolist'