-
Notifications
You must be signed in to change notification settings - Fork 412
[BugFix] Minor fixes PPO / A2C examples #1591
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
Conversation
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.
The tests are broken with
AttributeError: 'AtariEnv' object has no attribute 'append_transform'
this is because in PPO we don't put the env in a TransformedEnv.
Didn't we want to do this for DQN too?
Also, I was thinking: do we want to make this transform an "official" one? Would require tests and everything though.. Maybe we can leave it for later? Up to you!
Another point: Are we sure that this trick plays well with terminated
?
Now we will have some "done"
that are not synced with "terminated"
.
After #1581 this wil lbe an issue, that will require us to do:
loss.set_keys(done="end_of_life", terminated="end_of_life")
(i think)
examples/ppo/utils_atari.py
Outdated
if not is_test: | ||
reader = default_info_dict_reader(["end_of_life"]) | ||
env.set_info_dict_reader(reader) | ||
env = TransformedEnv(env, EndOfLifeTransform()) |
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.
we can just append the transform here (after you put your env in the TransformedEnv)
examples/a2c/utils_atari.py
Outdated
if not is_test: | ||
reader = default_info_dict_reader(["end_of_life"]) | ||
env.set_info_dict_reader(reader) | ||
env = TransformedEnv(env, EndOfLifeTransform()) |
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.
we can just append the transform here
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.
LGTM
Description
Some minor fixes in the PPO and A2C examples, related to the end-of-lives tranform.
Motivation and Context
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
You can use the syntax
close #15213
if this solves the issue #15213Types of changes
What types of changes does your code introduce? Remove all that do not apply:
Checklist
Go over all the following points, and put an
x
in all the boxes that apply.If you are unsure about any of these, don't hesitate to ask. We are here to help!