openai / gym

A toolkit for developing and comparing reinforcement learning algorithms.
https://www.gymlibrary.dev
Other
34.82k stars 8.61k forks source link

[Question] About Atari Env at version=0.26.0 #3144

Closed Aidilele closed 1 year ago

Aidilele commented 2 years ago

For the Atari env env=gym.make('PongNoFrameskip-v4'),the attrenv.spec.max_episode_steps get its value equal None,but at gym version=0.18.0,this value equals 400000. Whether this value is canceled due to version update?,if not,How can I get it at version=0.26.0

pseudo-rnd-thoughts commented 2 years ago

I don't understand why, but ale-py doesn't seem to use the time limit wrapper and instead pass the max number of steps per episode as a kwarg

>>> >>> gym.spec("PongNoFrameskip-v4")
EnvSpec(id='PongNoFrameskip-v4', entry_point='ale_py.env.gym:AtariEnv', reward_threshold=None, nondeterministic=False, max_episode_steps=None, order_enforce=True, autoreset=False, disable_env_checker=False, apply_api_compatibility=False, kwargs={'game': 'pong', 'obs_type': 'rgb', 'repeat_action_probability': 0.0, 'full_action_space': False, 'max_num_frames_per_episode': 108000, 'frameskip': 1}, namespace=None, name='PongNoFrameskip', version=4)

As you can see in the kwargs there is the parameter of "max_num_frames_per_episode"

rfali commented 1 year ago

@Aidilele , @pseudo-rnd-thoughts Maybe this could help clarify things (see the commit mentioned) https://github.com/mgbellemare/Arcade-Learning-Environment/issues/464#issuecomment-1550409776

Aidilele commented 1 year ago

Wonderful!