mit-acl / gym-collision-avoidance

MIT License
242 stars 74 forks source link

Error during executio initial example #14

Closed khalld closed 1 year ago

khalld commented 1 year ago

Hello, i'm having trouble during execution of src/example.py (using Python 3.6.15 and Mac OS ventura 13.3.1

Traceback (most recent call last):
  File "src/example.py", line 58, in <module>
    main()
  File "src/example.py", line 48, in main
    obs, rewards, game_over, which_agents_done = env.step(actions)
  File "/omittedownpath/gym-collision-avoidance/venv/lib/python3.6/site-packages/gym/wrappers/order_enforcing.py", line 37, in step
    return self.env.step(action)
  File "/omittedownpath/gym-collision-avoidance/venv/lib/python3.6/site-packages/gym/wrappers/env_checker.py", line 37, in step
    return env_step_passive_checker(self.env, action)
  File "/omittedownpath/gym-collision-avoidance/venv/lib/python3.6/site-packages/gym/utils/passive_env_checker.py", line 246, in env_step_passive_checker
    check_obs(obs, env.observation_space, "step")
  File "/omittedownpath/gym-collision-avoidance/venv/lib/python3.6/site-packages/gym/utils/passive_env_checker.py", line 159, in check_obs
    ), f"{pre} observation keys is not same as the observation space keys, obs keys: {list(obs.keys())}, space keys: {list(observation_space.spaces.keys())}"
AssertionError: The obs returned by the `step()` method observation keys is not same as the observation space keys, obs keys: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], space keys: ['is_learning', 'num_other_agents', 'dist_to_goal', 'heading_ego_frame', 'pref_speed', 'radius', 'other_agents_states']

Anyone could help ? I run the example with the created venv after runned install.sh

mfe7 commented 1 year ago

I saw this error recently from someone else and it was due to an updated method in the gym library. I need to push the commit from our internal repo to this github page, but here is the patch in the meantime (this also should allow using more modern python versions and tensorflow 2) 62bfad53fc980ce8b7c7761dec13ac78cb0883fa.patch

khalld commented 1 year ago

Hello, while waiting for the upgrade, I can confirm that works properly with gym 0.18.0. ( I was able to run example.py )

mfe7 commented 1 year ago

should be fixed now