agi-brain / xuance

XuanCe: A Comprehensive and Unified Deep Reinforcement Learning Library
https://xuance.readthedocs.io/
MIT License
578 stars 96 forks source link

MPE and GRF examples not working #50

Open ardian-selmonaj opened 1 month ago

ardian-selmonaj commented 1 month ago

I am trying to run your examples of mpe_mappo and football_qmix but I am getting errors when purely running your examples.

For MAPPO MPE with simple_spread_v3:

File "venv_xuan/lib/python3.9/site-packages/xuance/torch/agents/agents_marl.py", line 45, in __init__ self.n_agents = config.n_agents AttributeError: 'Namespace' object has no attribute 'n_agents'

For QMIX GRF: File "venv_xuan/lib/python3.9/site-packages/xuance/environment/__init__.py", line 29, in make_envs raise AttributeError(f"The vectorizer {config.vectorize} is not implemented.") AttributeError: The vectorizer Subproc_Football is not implemented.

I would highly appreciate your assistance! I have Python3.9 and gym 0.26.2.

wenzhangliu commented 1 month ago

I have tested and successfully run these two examples on my desktop. I believe the examples you tested are in the master branch, which is coded for the newest version of the master branch. I suggest you use the code in the stable master branch.

Additionally, I have released the latest version of XuanCe (v1.2.2) on PyPI today. You can try it again and post your feedback anytime.

ardian-selmonaj commented 6 days ago

Hi, thank you for your help. I indeed had to use the stable version in order to make it run. However, I just installed the package with pip install xuance[torch], so in fact it should automatically install the stable version, or not? Because in the configs folder of the installed package I see more configurations than on the stable branch. In fact, the same as in the master branch.

ardian-selmonaj commented 6 days ago

I still have an error for Robotic Warehouse env, even when I proceed exactly as in the stable version. See below.

File "/home/ardianselmonaj/Projects/MARL_World/xuan_qmix_rware.py", line 30, in <module> envs = make_envs(configs) # Make the environment. File "/home/ardianselmonaj/Projects/MARL_World/venv1/lib/python3.10/site-packages/xuance/environment/__init__.py", line 29, in make_envs raise AttributeError(f"The vectorizer {config.vectorize} is not implemented.") AttributeError: The vectorizer Dummy_RoboticWarehouse is not implemented.

When I try to change vectorize into SubprocVecMultiAgentEnv or DummyVecMultiAgentEnv, I get:

File "/home/ardianselmonaj/Projects/MARL_World/venv1/lib/python3.10/site-packages/xuance/environment/__init__.py", line 19, in _thunk return XuanCeMultiAgentEnvWrapper(REGISTRY_MULTI_AGENT_ENV[config.env_name](config)) File "/home/ardianselmonaj/Projects/MARL_World/venv1/lib/python3.10/site-packages/xuance/environment/multi_agent_env/robotic_warehouse.py", line 14, in __init__ self.env = gym.make(config.env_id) File "/home/ardianselmonaj/Projects/MARL_World/venv1/lib/python3.10/site-packages/gym/envs/registration.py", line 569, in make _check_version_exists(ns, name, version) File "/home/ardianselmonaj/Projects/MARL_World/venv1/lib/python3.10/site-packages/gym/envs/registration.py", line 219, in _check_version_exists _check_name_exists(ns, name) File "/home/ardianselmonaj/Projects/MARL_World/venv1/lib/python3.10/site-packages/gym/envs/registration.py", line 197, in _check_name_exists raise error.NameNotFound( gym.error.NameNotFound: Environment rware-tiny-2ag doesn't exist.