xuance icon indicating copy to clipboard operation
xuance copied to clipboard

MPE env not working.

Open chenhuiapp opened this issue 1 year ago • 3 comments

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'

chenhuiapp avatar Sep 16 '23 15:09 chenhuiapp

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)

wenzhangliu avatar Sep 18 '23 07:09 wenzhangliu

Thank you.

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

chenhuiapp avatar Sep 20 '23 00:09 chenhuiapp

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 avatar Sep 20 '23 07:09 wenzhangliu