Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to export or load multi-agent policies? #49

Open
ardian-selmonaj opened this issue Jul 24, 2024 · 6 comments
Open

How to export or load multi-agent policies? #49

ardian-selmonaj opened this issue Jul 24, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@ardian-selmonaj
Copy link

ardian-selmonaj commented Jul 24, 2024

In a multi-agent setting, when training e.g. MAPPO_Agents(), then calling MAPPO_Agents.save_model(model_name='model.pth') and finally loading the model MAPPO_Agents.load_model(path), how can I extract specific policies out of the model? e.g. when 3 agents were trained, "agent_1", "agent_2" and "agent_3", I would like to have the prediction only of a specific agent.

I didn't find out how to exactly do that and would be very thankful for any help.

@ardian-selmonaj ardian-selmonaj changed the title How to export multi-agent policies? How to export or load multi-agent policies? Jul 24, 2024
@wenzhangliu
Copy link
Collaborator

Hello, we are very sorry that we have not considered the operation of saving and loading a specific agent model for MARL. At present, saving and loading models in XuanCe are used for the holistic MARL models. We will consider fixing this issue in the future version of XuanCe. Thanks very much for your questions.

@wenzhangliu wenzhangliu added the enhancement New feature or request label Jul 25, 2024
@ardian-selmonaj
Copy link
Author

This would be very helpful! I like your overall framework for training and evaluating RL agents and the variety of algorithms, but accessing specific MARL policies for inference is indeed an important feature.

@wenzhangliu
Copy link
Collaborator

Thank you for your advice; we will consider supporting this function very soon.

@ardian-selmonaj
Copy link
Author

ardian-selmonaj commented Jul 25, 2024

Additionally, can you also consider adding a feature to train selected agents with a shared policy? e.g. ag1 and ag2 use the same pi1 but ag3 uses pi2 and so on. This would allow to train the same type of agents in a heterogeneous setting with the same policies.

@wenzhangliu
Copy link
Collaborator

It's a good suggestion for more general scenarios, implementing this feature in the current version of XuanCe sounds not easy. We may need to rebuild the policy module of XuanCe to determine whether or not some agents use shared policy.

@ardian-selmonaj
Copy link
Author

Ray RLlib supports both these features, however their variety of algorithms is limited. Anyhow, I would be very thankful if you could provide these features soon. I assume many others would benefit from it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants