Strange bug! Add {"new_step_api": True} in gym environments.
This commit is contained in:
14
examples/evox_/gym_env_test.py
Normal file
14
examples/evox_/gym_env_test.py
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user