Lizhi-sjtu / MARL-code-pytorch

Concise pytorch implements of MARL algorithms, including MAPPO, MADDPG, MATD3, QMIX and VDN.
MIT License
410 stars 51 forks source link

Discrete action #3

Open Bruce-Lan-ZY opened 2 years ago

Bruce-Lan-ZY commented 2 years ago

(MARL) root@5e4fd369caa6:~/code/MARL-code-pytorch/4.MADDPG_MATD3_MPE# python3 MADDPG_MATD3_main.py --algorithm MADDPG Traceback (most recent call last): File "MADDPG_MATD3_main.py", line 142, in runner = Runner(args, env_name=env_names[env_index], number=1, seed=0) File "MADDPG_MATD3_main.py", line 19, in init self.env = make_env(env_name, discrete=False) # Continuous action space TypeError: make_env() got an unexpected keyword argument 'discrete'

Then, I try to remove this argument'discrete' ------self.env = make_env(env_name). There appear this problem:

(MARL) root@5e4fd369caa6:~/code/MARL-code-pytorch/4.MADDPG_MATD3_MPE# python3 MADDPG_MATD3_main.py --algorithm MADDPG Traceback (most recent call last): File "MADDPG_MATD3_main.py", line 142, in runner = Runner(args, env_name=env_names[env_index], number=1, seed=0) File "MADDPG_MATD3_main.py", line 23, in init self.args.action_dim_n = [self.env.action_space[i].shape[0] for i in range(self.args.N)] # actions dimensions of N agents File "MADDPG_MATD3_main.py", line 23, in self.args.action_dim_n = [self.env.action_space[i].shape[0] for i in range(self.args.N)] # actions dimensions of N agents IndexError: tuple index out of range

Could anyone help me?

air-tea commented 1 year ago

I also met this problem, have you solved it?

Bruce-Lan-ZY commented 1 year ago

No, I used other repos.

wydxry commented 1 year ago

You should add multiagent and change make_env.py about discrete

air-tea commented 1 year ago

Got it, Thanks for your answering~

weiyu0258 commented 4 months ago

I remove the argument 'discrete',and then change the multiagent-particle-envs-master\multiagent\environment\self.discrete_action_input = True, the code run successfully