Atcold / pytorch-PPUU

Code for Prediction and Planning Under Uncertainty (PPUU)
https://youtu.be/X2s7gy3wIYw
MIT License
203 stars 54 forks source link

running error of play_maps.py #68

Open KeysaYoung opened 2 years ago

KeysaYoung commented 2 years ago
python play_maps.py -map i80
Traceback (most recent call last):
  File "play_maps.py", line 81, in <module>
    observation, reward, done, info = env.step(action)
  File "/anaconda3/envs/PPUU/lib/python3.8/site-packages/gym/wrappers/order_enforcing.py", line 37, in step
    return self.env.step(action)
  File "/anaconda3/envs/PPUU/lib/python3.8/site-packages/gym/wrappers/step_api_compatibility.py", line 52, in step
    step_returns = self.env.step(action)
  File "/anaconda3/envs/PPUU/lib/python3.8/site-packages/gym/wrappers/env_checker.py", line 37, in step
    return env_step_passive_checker(self.env, action)
  File "/anaconda3/envs/PPUU/lib/python3.8/site-packages/gym/utils/passive_env_checker.py", line 269, in env_step_passive_checker
    assert isinstance(
AssertionError: The `info` returned by `step()` must be a python dictionary, actual type: <class 'NoneType'>
Atcold commented 2 years ago

play_maps.py has 79 lines. How is it that you're getting an error at line 81?

915414922 commented 1 year ago

I also got the same problem.

python play_maps.py -map i80
Traceback (most recent call last):
  File "play_maps.py", line 73, in <module>
    observation, reward, done, info = env.step(numpy.zeros((2,)))
  File "/home/workspace/anaconda3/envs/PPUU/lib/python3.8/site-packages/gym/wrappers/order_enforcing.py", line 37, in step
    return self.env.step(action)
  File "/home/workspace/anaconda3/envs/PPUU/lib/python3.8/site-packages/gym/wrappers/env_checker.py", line 37, in step
    return env_step_passive_checker(self.env, action)
  File "/home/workspace/anaconda3/envs/PPUU/lib/python3.8/site-packages/gym/utils/passive_env_checker.py", line 261, in env_step_passive_checker
    assert isinstance(
AssertionError: The `info` returned by `step()` must be a python dictionary, actual type: <class 'NoneType'>
YarekSvyryda commented 1 month ago

@915414922 Just downgrade the version of gym to 0.13.0.

In enviroment.yaml no specific version of gym is mentioned, so it grabs the latest. And because of that checker doesn't allow None to be returned by step().