MARL-code-pytorch icon indicating copy to clipboard operation
MARL-code-pytorch copied to clipboard

Discrete action

Open Bruce-Lan-ZY opened this issue 2 years ago • 5 comments

(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?

Bruce-Lan-ZY avatar Sep 09 '22 07:09 Bruce-Lan-ZY

I also met this problem, have you solved it?

air-tea avatar Oct 13 '22 09:10 air-tea

No, I used other repos.

Bruce-Lan-ZY avatar Oct 13 '22 09:10 Bruce-Lan-ZY

You should add multiagent and change make_env.py about discrete

wydxry avatar Oct 27 '22 12:10 wydxry

Got it, Thanks for your answering~

air-tea avatar Oct 27 '22 13:10 air-tea

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

weiyu0258 avatar Apr 18 '24 13:04 weiyu0258