-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
vec_env
s fix seed()
causing a reset
#1486
Conversation
Note: I have not added new tests. (If you have a test suggestion i can put it in) Neither updated the DOC. (as I am changing it to the already documented behavior) |
|
I will for the next commits.
what exactly? You can still run mypy and ruff though, that should catch most issues. PS: please use |
@araffin do you need help with debugging why |
Thanks for the offer, but the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed changes, seem to solve the problem. Tests correctly updated.
(Note: need to do a release on PyPi as soon as it is merged, otherwise it would break SB3 contrib) |
return vec_env_cls([make_env(i + start_index) for i in range(n_envs)], **vec_env_kwargs) | ||
vec_env = vec_env_cls([make_env(i + start_index) for i in range(n_envs)], **vec_env_kwargs) | ||
# Prepare the seeds for the first reset | ||
vec_env.seed(seed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simple comment: in this context, the method vec_env.seed
affects at the next reset a unique seed for each of the environments in the same manner as env.action_space.seed(seed + rank)
Description
fixes issue :#1481
by keeping a
self.seeds
variable inside theenv
Motivation and Context
closes #1481
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