-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to newest Gym version #572
Conversation
Looks like something is not working out right. Possible thing from Gym 0.20? def _check_obs(obs: Union[tuple, dict, np.ndarray, int], observation_space: spaces.Space, method_name: str) -> None:
"""
Check that the observation returned by the environment
correspond to the declared one.
"""
if not isinstance(observation_space, spaces.Tuple):
assert not isinstance(
obs, tuple
), f"The observation returned by the `{method_name}()` method should be a single value, not a tuple"
# The check for a GoalEnv is done by the base class
if isinstance(observation_space, spaces.Discrete):
assert isinstance(obs, int), f"The observation returned by `{method_name}()` method must be an int"
elif _is_numpy_array_space(observation_space):
assert isinstance(obs, np.ndarray), f"The observation returned by `{method_name}()` method must be a numpy array"
> assert observation_space.contains(
obs
), f"The observation returned by the `{method_name}()` method does not match the given observation space"
E AssertionError: The observation returned by the `reset()` method does not match the given observation space |
yep, probably comes from wrong dtype, I fixed several issues yesterday: cyprienc@e7a48d2 |
We also need to fix that issue: #573 (comment) |
So to fix the error with breakout, the new command equivalent to the noframeskip is |
wait, what is the new default behavior? and why? and |
@araffin there's no longer any environment suffixes like Regarding the frameskip setting, it's always been a misnomer. It's really "how many frames is the action applied for" NOT "how many frames are skipped after the action was executed". A frameskip of 1 means the action is applied for one frame. See: https://github.com/mgbellemare/Arcade-Learning-Environment/blob/79ffb7d5c8d404bdde951d45bef263b1a1f84125/src/gym/envs/atari/environment.py#L222-L223 and https://github.com/mgbellemare/Arcade-Learning-Environment/blob/79ffb7d5c8d404bdde951d45bef263b1a1f84125/src/environment/stella_environment.cpp#L157 Hope that helps clear things up. |
Thanks for the answer =)
I see, yes a bit confusing name and we actually do the same in SB3 max and skip wrapper, I've seen the name "action repeat" instead too, which better illustrate its action.
but what is the default option then? and what was the default option before for the v4 envs? (with |
@JesseFarebro looking at https://brosa.ca/blog/ale-release-v0.7, I assume that frameskip=5 and action set is "full" with 0.25 sticky probability. |
Side note: if we want to upgrade to gym 0.21, not only code, test and documentation must be updated but also all our notebook tutorials...
EDIT: I forgot the RL Zoo too: https://github.com/DLR-RM/rl-baselines3-zoo |
@araffin there was some miscommunication on my part (and some false assumptions) which lead to a frameskip of 5 being the default for Sorry for the confusion, I hope this clears things up. |
thanks for the clarification, is it the same for the action set? |
@araffin sorry for the delay, I was still trying to sort this all out. It makes sense to use the minimal action set to stay as close to the post-DQN methodology as possible. |
ok, then at that point, it would maybe make sense to either keep v4 (and not drop them in the future at it was intended) or provide a version with fixes (if I recall, |
@araffin There are still differences which we'd like to fix so the bump to
The |
I see that this PR has been closed. Is there any plan to support gym 0.20 or greater out of the box? (I saw the comment on #674 to install without dependencies to avoid the gym version conflict). |
This PR has been closed in favor of #705, help is also welcomed to update the doc #705 (comment) We may also wait for openai/gym#2531 to be fixed too. |
Thanks. Will take a look at #705. Looks like openai/gym#2531 has been fixed so maybe wait for a 0.22 release of gym? |
@araffin openai/gym#2531 doesn't impact any current release and we aren't releasing the next version until it's fixed. |
Description
This should fix CI for Gym 0.20.0 wrt Atari ROMs
Types of changes
Checklist:
make format
(required)make check-codestyle
andmake lint
(required)make pytest
andmake type
both pass. (required)make doc
(required)Note: You can run most of the checks using
make commit-checks
.Note: we are using a maximum length of 127 characters per line