Agent_ids that are not the names of the agents in the env

  • Medium: It contributes to significant difficulty to complete my task, but I can work around it.

Hi all, sorry if this is a very basic question. I am trying to run codes from “Hands-on RL with Ray’s RLlib tutorial”.
https://github.com/sven1977/rllib_tutorials/blob/main/ray_summit_2021/tutorial_notebook.ipynb
When I add “super(MultiAgentArena, self).init()” within the MutiAgentEnv’s constructor, I get this error:

ValueError: The element returned by reset() has agent_ids that are not the names of the agents in the env. 
Agent_ids in this MultiAgentDict: ['agent1', 'agent2']
Agent_ids in this env:[]. You likley need to add the private attribute `_agent_ids` to your env, which is a set containing the ids of agents supported by your env.

I cannot understand why this happens, I have the same error with another code that I am trying to develop, so I guess if I can solve this problem for the tutorial, I can solve my own code.

I use ray 1.13.

Thanks :).

1 Like

Hi @Mehdi,

Welcome to the forum.

Try adding

"disable_env_checking": True

to the RLLib config.

I think the tutorial also needs to be updated to work with the changes to the MultiAgentEnv from 1.11.0

Hi @mannyv , thanks, yes it works.