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

MPE env not working. #4

Open
chenhuiapp opened this issue Sep 16, 2023 · 3 comments
Open

MPE env not working. #4

chenhuiapp opened this issue Sep 16, 2023 · 3 comments
Labels
question Further information is requested

Comments

@chenhuiapp
Copy link

FileNotFoundError Traceback (most recent call last)
in <cell line: 1>()
----> 1 runner = xp.get_runner(method='maddpg',
2 env='mpe',
3 env_id='simple_spread',
4 is_test=False)

2 frames
/usr/local/lib/python3.10/dist-packages/xuanpolicy/common/common_tools.py in get_config(file_name)
22
23 def get_config(file_name):
---> 24 with open(file_name, "r") as f:
25 try:
26 config_dict = yaml.load(f, Loader=yaml.FullLoader)

FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.10/dist-packages/xuanpolicy/configs/maddpg/mpe/simple_spread.yaml'

@wenzhangliu
Copy link
Collaborator

wenzhangliu commented Sep 18, 2023

Hi, you need to use "simple_spread_v3" instead of "simple_spread" for env_id. You can also create a new file named "simple_spread.yaml" and set hyperparameters according to "xuanpolicy/configs/maddpg/mpe/simple_spread_v3.yaml". Then get runner by

runner = xp.get_runner(method='maddpg', env='mpe', 'env_id'='simple_spread_v3', 'config_path'='your config path', is_test=False)

@chenhuiapp
Copy link
Author

Thank you.

How can I visualize a trained model, and how can i specify the action to be discrete or continuous?

@wenzhangliu
Copy link
Collaborator

If you want to visualize the model, you can set "render: True" in xuanpolicy/configs/basic.yaml file. After training or testing the model, you can see the videos with tensorboard or wandb (by setting "logger: tensorboard" or "logger: wandb", respectively).

As for discrete or continuous actions, you can set the "continuous_action" as False or True in xuanpolicy/configs/xxx/xxx.yaml file. This parameter takes effect at line 12 of python file xuanpolicy/environment/pettingzoo/pettingzoo.env. (version 0.1.9)

@wenzhangliu wenzhangliu added the question Further information is requested label Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants