New observation and action spaces in Ray 2.0

How severe does this issue affect your experience of using Ray?

  • High: It blocks me to complete my task.

QUESTION: Since the new Ray 2.0 I have experienced errors and warnings that weren’t there before regarding the observation and sample spaces.

Q1) Can anyone provide a simple working example of how to define these new methods now:

observation_space_sample()
observation_space_contains()
action_space_sample()
action_space_contains()

Q2) when they are absolutely needed, and when they can be left without implementation)

Thanks!

If your spaces are gym.spaces objects, they should already have those methods. Is it possible you have defined your space as something else instead? E.g. a python Tuple instead of a gym spaces Tuple?

I believe for multiagent envs, this should now be a gym.spaces.Dict that maps from agent IDs to their respective spaces. (But not just a python dict, I think.)

Setting "disable_env_checking": True in your config might also do the trick, although I’m not 100% sure that there aren’t any other bits of code that use those methods.

We’ve merged a related PR a couple of weeks back that should now be in Ray 2.0.1. Does this resolve your issue?

1 Like

Thank you very much.