facebookresearch / BenchMARL

A collection of MARL benchmarks based on TorchRL
https://benchmarl.readthedocs.io/
MIT License
292 stars 42 forks source link

Vmas supported tasks #55

Closed prinshul closed 10 months ago

prinshul commented 10 months ago

Hi,

Only the below tasks supported from the vmas?

    vmas_balance_config
    vmas_navigation_config
    vmas_sampling_config
    vmas_simple_adversary_config
    vmas_simple_crypto_config
    vmas_simple_push_config
    vmas_simple_reference_config
    vmas_simple_speaker_listener_config
    vmas_simple_spread_config
    vmas_simple_tag_config
    vmas_simple_world_comm_config
    vmas_transport_config
    vmas_wheel_config
matteobettini commented 10 months ago

You can see the available tasks here https://benchmarl.readthedocs.io/en/latest/generated/benchmarl.environments.VmasTask.html#benchmarl.environments.VmasTask .

In theory all scenarios are supported so if you are interested in a vmas scenario that is not there, we can add it

prinshul commented 10 months ago

Actually when I ran 'give_way' (for example)

python fine_tuned/vmas/vmas_run.py algorithm=mappo task=vmas/give_way

I am getting the below error: File "/home/iitdpc/miniconda3/envs/marl_bench/lib/python3.9/site-packages/hydra/_internal/utils.py", line 458, in lambda: hydra.run( File "/home/iitdpc/miniconda3/envs/marl_bench/lib/python3.9/site-packages/hydra/_internal/hydra.py", line 105, in run cfg = self.compose_config( File "/home/iitdpc/miniconda3/envs/marl_bench/lib/python3.9/site-packages/hydra/_internal/hydra.py", line 594, in compose_config cfg = self.config_loader.load_configuration( File "/home/iitdpc/miniconda3/envs/marl_bench/lib/python3.9/site-packages/hydra/_internal/config_loader_impl.py", line 142, in load_configuration return self._load_configuration_impl( File "/home/iitdpc/miniconda3/envs/marl_bench/lib/python3.9/site-packages/hydra/_internal/config_loader_impl.py", line 253, in _load_configuration_impl defaults_list = create_defaults_list( File "/home/iitdpc/miniconda3/envs/marl_bench/lib/python3.9/site-packages/hydra/_internal/defaults_list.py", line 745, in create_defaults_list defaults, tree = _create_defaults_list( File "/home/iitdpc/miniconda3/envs/marl_bench/lib/python3.9/site-packages/hydra/_internal/defaults_list.py", line 715, in _create_defaults_list defaults_tree = _create_defaults_tree( File "/home/iitdpc/miniconda3/envs/marl_bench/lib/python3.9/site-packages/hydra/_internal/defaults_list.py", line 356, in _create_defaults_tree ret = _create_defaults_tree_impl( File "/home/iitdpc/miniconda3/envs/marl_bench/lib/python3.9/site-packages/hydra/_internal/defaults_list.py", line 457, in _create_defaults_tree_impl return _expand_virtual_root(repo, root, overrides, skip_missing) File "/home/iitdpc/miniconda3/envs/marl_bench/lib/python3.9/site-packages/hydra/_internal/defaults_list.py", line 280, in _expand_virtual_root subtree = _create_defaults_tree_impl( File "/home/iitdpc/miniconda3/envs/marl_bench/lib/python3.9/site-packages/hydra/_internal/defaults_list.py", line 573, in _create_defaults_tree_impl add_child(children, new_root) File "/home/iitdpc/miniconda3/envs/marl_bench/lib/python3.9/site-packages/hydra/_internal/defaults_list.py", line 520, in addchild subtree = _create_defaults_tree_impl( File "/home/iitdpc/miniconda3/envs/marl_bench/lib/python3.9/site-packages/hydra/_internal/defaults_list.py", line 488, in _create_defaults_tree_impl config_not_found_error(repo=repo, tree=root) File "/home/iitdpc/miniconda3/envs/marl_bench/lib/python3.9/site-packages/hydra/_internal/defaults_list.py", line 799, in config_not_found_error raise MissingConfigException( hydra.errors.MissingConfigException: In 'config': Could not find 'task/vmas/give_way'

Available options in 'task': pettingzoo_multiwalker_config pettingzoo_simple_adversary_config pettingzoo_simple_crypto_config pettingzoo_simple_push_config pettingzoo_simple_reference_config pettingzoo_simple_speaker_listener_config pettingzoo_simple_spread_config pettingzoo_simple_tag_config pettingzoo_simple_world_comm_config pettingzoo_waterworld_config vmas_balance_config vmas_navigation_config vmas_sampling_config vmas_simple_adversary_config vmas_simple_crypto_config vmas_simple_push_config vmas_simple_reference_config vmas_simple_speaker_listener_config vmas_simple_spread_config vmas_simple_tag_config vmas_simple_world_comm_config vmas_transport_config vmas_wheel_config Config search path: provider=hydra, path=pkg://hydra.conf provider=main, path=file:///hdd3/marl_new/BenchMARL/fine_tuned/vmas/conf provider=hydra.searchpath in main, path=pkg://benchmarl.conf provider=schema, path=structured://

Am I doing something wrong?

prinshul commented 10 months ago

If it's possible for me I can can add. Can you suggest how? I need debug tasks as well like asym_joint, het_mass, diff_drive, Kinematic bicycle And main tasks like windflocking are needed for my work.

matteobettini commented 10 months ago

You need to install benchmarl from github (pull the latest) since some tasks were added after 1.0.0

to add new vmas tasks just follow this guide https://github.com/facebookresearch/BenchMARL/tree/main/examples/extending/task

prinshul commented 10 months ago

You need to install benchmarl from github (pull the latest) since some tasks were added after 1.0.0

to add new vmas tasks just follow this guide https://github.com/facebookresearch/BenchMARL/tree/main/examples/extending/task

And the new tasks will run with default hyperparameters?

matteobettini commented 10 months ago

To see how you can add more vmas scenarios, for example you can look at this PR I just made where i integrated more of them #48. Essentially you will need:

  1. to add the task name in the enum in environemnts/vmas/common.py
  2. add the task python dataclass in environments/vmas/<your_task>.py
  3. add the task yaml file that fills the dataclass in conf/task/vmas/<your_task>.yaml
  4. add the task to the registry in environments/__init__.py

Regarding hyperparameters, you can use the ones you want. The default task parameters that you chose are in conf/task/vmas/<your_task>.yaml. For the training parameters, you can use the ones in the fine_tuned folder for inspiration, but you might want to change some stuff depending on the task.

prinshul commented 10 months ago

Thank you for all your prompt responses.

So the hyperparameters in the fine_tuned vmas folder may not apply to say wheel with MADDPG (off-policy algorithm)? As with fine-tuned vmas hyperparameters I am getting below curve [wheel + MADDPG]: Screenshot 2024-01-20 at 8 22 07 PM

matteobettini commented 10 months ago

You may need to give it more time, but in general no.

Some VMAS task can be hard to solve. That is also why they exist, cause if you were able to solve all of them with vanilla algos, they would not be useful.