agi-brain/xuance

The qmix_rware error message in the running examples is as follows, there is a corresponding solution

Opened this issue · 1 comments

Yu-zx commented

Traceback (most recent call last):
File "D:/code/DRL/xuance-master-1/examples/qmix/qmix_rware.py", line 311, in
runner = Runner(args)
File "D:/code/DRL/xuance-master-1/examples/qmix/qmix_rware.py", line 70, in init
self.envs = make_envs(args)
File "D:\code\DRL\xuance-master-1\xuance\environment_init_.py", line 129, in make_envs
return REGISTRY_VEC_ENV[config.vectorize]([thunk for _ in range(config.parallels)])
File "D:\code\DRL\xuance-master-1\xuance\environment\robotic_warehouse\robotic_warehouse_vec_env.py", line 6, in init
super(DummyVecEnv_RoboticWarehouse, self).init(env_fns)
File "D:\code\DRL\xuance-master-1\xuance\environment\new_env_mas\new_vec_env_mas.py", line 147, in init
self.envs = [fn() for fn in env_fns]
File "D:\code\DRL\xuance-master-1\xuance\environment\new_env_mas\new_vec_env_mas.py", line 147, in
self.envs = [fn() for fn in env_fns]
File "D:\code\DRL\xuance-master-1\xuance\environment_init
.py", line 78, in _thunk
env = RoboticWarehouseEnv(config, render_mode=config.render_mode)
File "D:\code\DRL\xuance-master-1\xuance\environment\robotic_warehouse\robotic_warehouse_env.py", line 9, in init
self.env = gym.make(ENV_IDs[args.env_id])
File "D:\anaconda3\envs\xuance_env\lib\site-packages\gym\envs\registration.py", line 640, in make
env = env_creator(**_kwargs)
File "D:\anaconda3\envs\xuance_env\lib\site-packages\rware\warehouse.py", line 247, in init
self._use_slow_obs()
File "D:\anaconda3\envs\xuance_env\lib\site-packages\rware\warehouse.py", line 359, in _use_slow_obs
for _ in range(self.n_agents)
File "D:\anaconda3\envs\xuance_env\lib\site-packages\rware\warehouse.py", line 359, in
for _ in range(self.n_agents)
File "D:\anaconda3\envs\xuance_env\lib\site-packages\gym\spaces\multi_binary.py", line 44, in init
assert (np.asarray(input_n) > 0).all() # n (counts) have to be positive
AssertionError

For multi-robot warehouse (RWARE) environment, the version of gym is suggeted to be 0.21 according its the offcial instruction (https://github.com/semitable/robotic-warehouse/blob/master/setup.py)..

Hence, when you run this environment with XuanCe, you should downgrade the version of gym by typing
pip install gym==0.21
That will help you solve the problem.