Strange bug! Add {"new_step_api": True} in gym environments.

This commit is contained in:
wls2002
2023-07-05 15:39:22 +08:00
parent 7bf46575f4
commit 2cc72bb188
5 changed files with 18 additions and 3 deletions

View File

@@ -0,0 +1,14 @@
import gym
env = gym.make("CartPole-v1", new_step_api=True)
print(env.reset())
obs = env.reset()
print(obs)
while True:
action = env.action_space.sample()
obs, reward, terminate, truncate, info = env.step(action)
print(obs, info)
if terminate | truncate:
break