You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/home/costa/Documents/go/src/github.com/vwxyzjn/envpool-cleanrl/bug.py", line 22, in<module>envs.step(np.array([envs.action_space.sample() for_in range(envs.num_envs)]))
File "/home/costa/.cache/pypoetry/virtualenvs/envpool-cleanrl-uAHoRI5J-py3.9/lib/python3.9/site-packages/gym/core.py", line 532, in step
step_returns = self.env.step(action)
File "/home/costa/.cache/pypoetry/virtualenvs/envpool-cleanrl-uAHoRI5J-py3.9/lib/python3.9/site-packages/gym/wrappers/normalize.py", line 149, in step
self.env.step(action), True, self.is_vector_env
File "/home/costa/.cache/pypoetry/virtualenvs/envpool-cleanrl-uAHoRI5J-py3.9/lib/python3.9/site-packages/gym/core.py", line 493, in step
step_returns = self.env.step(action)
File "/home/costa/.cache/pypoetry/virtualenvs/envpool-cleanrl-uAHoRI5J-py3.9/lib/python3.9/site-packages/gym/wrappers/normalize.py", line 77, in step
obs, rews, terminateds, truncateds, infos = step_api_compatibility(
File "/home/costa/.cache/pypoetry/virtualenvs/envpool-cleanrl-uAHoRI5J-py3.9/lib/python3.9/site-packages/gym/utils/step_api_compatibility.py", line 178, in step_api_compatibility
return step_to_new_api(step_returns, is_vector_env)
File "/home/costa/.cache/pypoetry/virtualenvs/envpool-cleanrl-uAHoRI5J-py3.9/lib/python3.9/site-packages/gym/utils/step_api_compatibility.py", line 59, in step_to_new_api
and not infos["_TimeLimit.truncated"][i]
KeyError: '_TimeLimit.truncated'
Expected behavior
It would be great if envpool is compatible with the gym normalize wrappers or the other way around.
System info
Describe the characteristic of your environment:
Describe how the library was installed (pip, source, ...)
Maybe it's a bug from gym instead of envpool? I can only find 3 places that use _TimeLimit.truncated in gym repo main branch. The buggy one is from step_to_new_api while the other two are from step_to_old_api. It seems like step_to_new_api refers to an unknown key before assigning actual value to info dict, however, step_to_old_api doesn't have this issue.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior.
Please try to provide a minimal example to reproduce the bug. Error messages and stack traces are also helpful.
Please use the markdown code blocks for both code and stack traces.
Expected behavior
It would be great if envpool is compatible with the gym normalize wrappers or the other way around.
System info
Describe the characteristic of your environment:
Reason and Possible fixes
I think the reason is the new
gym.wrappers.NormalizeReward
wrapper expects to see something like_TimeLimit.truncated
in the info section...Checklist
The text was updated successfully, but these errors were encountered: