Farama-Foundation / PettingZoo

An API standard for multi-agent reinforcement learning environments, with popular reference environments and related utilities
https://pettingzoo.farama.org
Other
2.62k stars 413 forks source link

How to train magent by stable_baselines3? #587

Closed loveisacat closed 2 years ago

loveisacat commented 2 years ago

Stable_baselines3 can only train the env of "gym"? Or how to convert the magent-type env to gym-type env that can be trained by stable_baselines3?

benblack769 commented 2 years ago

MAgent is a very tricky environment to train with SB3. You can try to use use supersuit's supersuit.pettingzoo_env_to_vec_env_v1 to convert a pettingzoo parallel environment to a Sb3 vector environment. However, since this is a competitive environment, it might or might not work, due to the challenges of self-play in competitive environments.

benblack769 commented 2 years ago

Note that no one I am aware of has tried to use Sb3 to train magent. Its observation is symmetric enough that self-play might be efficient. Its also worth noting that to reproduce the original results, you should train with minimap_mode, which gives each agent access to a global view of the map.

loveisacat commented 2 years ago

Note that no one I am aware of has tried to use Sb3 to train magent. Its observation is symmetric enough that self-play might be efficient. Its also worth noting that to reproduce the original results, you should train with minimap_mode, which gives each agent access to a global view of the map.

Thanks for your reply. If I want to train many regular RL algorithms like PPO, A3C in magent. Which RL training tool is recommended except Sb3? Especially the tools developed based on PyTorch, which do you recommend?

jkterry1 commented 2 years ago

Hey, RLlib is probably what you're looking for