proroklab / adversarial_comms

GNU General Public License v3.0
30 stars 4 forks source link

Obs and obs space mismatch for all scenarios #4

Open heng2j opened 2 years ago

heng2j commented 2 years ago

Hi @janblumenkamp and @matteobettini ,

I checkout code and installed according to README.md with older version of Ray 1.3.0 and its' dependencies. When trained with recommended commands i.e. train_policy coverage -t 20 . I got he following obs to ob space mismatches.

Can you advise?

Here are the extracts of the error log from ray tune:

  File "/heng/env/miniconda3/envs/ac_env/lib/python3.7/site-packages/ray/rllib/models/preprocessors.py", line 257, in transform
    self.check_shape(observation)
  File "/heng/env/miniconda3/envs/ac_env/lib/python3.7/site-packages/ray/rllib/models/preprocessors.py", line 68, in check_shape
    observation, self._obs_space)
ValueError: ('Observation ({}) outside given space ({})!', {'agents': ({'map': array([[[0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
        [1, 0],
        [1, 0],
        [1, 0],
        [1, 0]],
...

 Dict(agents:Tuple(Dict(map:Box(0.0, inf, (16, 16, 2), float32), pos:Box(0, 24, (2,), int64)), Dict(map:Box(0.0, inf, (16, 16, 2), float32), pos:Box(0, 24, (2,), int64)), Dict(map:Box(0.0, inf, (16, 16, 2), float32), pos:Box(0, 24, (2,), int64)), Dict(map:Box(0.0, inf, (16, 16, 2), float32), pos:Box(0, 24, (2,), int64)), Dict(map:Box(0.0, inf, (16, 16, 2), float32), pos:Box(0, 24, (2,), int64)), Dict(map:Box(0.0, inf, (16, 16, 2), float32), pos:Box(0, 24, (2,), int64))), gso:Box(-inf, inf, (6, 6), float32), state:Box(0.0, 2.0, (24, 24, 4), float32)))

Thank you, Heng

heng2j commented 2 years ago

Looks like the issue can only be resolved if we roll back gym version to 0.17.3 as mentioned in rllib_differentiable_comms .

Therefore, I recommend that until refactor the code to use the latest OpenAi gym, please update requirements.txt to pin the version of gym to 0.17.3