-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
[RLlib] Remove old gym monitor code and add new API #37922
Closed
ArturNiederfahrenhorst
wants to merge
76
commits into
ray-project:master
from
ArturNiederfahrenhorst:removeataristuffaddrecorder
+99
−109
Closed
Changes from 74 commits
Commits
Show all changes
76 commits
Select commit
Hold shift + click to select a range
9dd8b29
bump to 0.28.1
5e860cd
Merge branch 'master' into gymnasium
3189e30
Merge branch 'master' into gymnasium
bd070e5
fix test
fbedf59
Merge branch 'master' into gymnasium
7402830
Atari is now supported by gymnasium
Rohan138 9d2e601
Merge branch 'gymnasium' of https://github.com/Rohan138/ray into gymn…
Rohan138 03e3c4b
Remove all import gym calls
Rohan138 98506e3
Fix env instantiation for env classes
0f39209
fix atari wrappers
0affa2a
Merge branch 'master' into gymnasium
c925e59
fix pong notebook
06e78e1
fix pong notebook
ecce074
Merge branch 'master' into gymnasium
65b2eec
Add comment
a5bba3c
Merge branch 'master' into gymnasium
68f3cb5
Empty commit
74d4461
Remove gym from requirements
635ab9c
Merge branch 'master' into gymnasium
4f5ef24
Merge branch 'master' of github.com:ray-project/ray into gymnasium
f5ecaa6
merge
sven1977 cbc22f3
test other version combination
sven1977 5833a90
merge
sven1977 acaa683
wip
sven1977 829d290
wip
sven1977 7842ff9
wip
sven1977 b95a0a5
wip
sven1977 f926316
wip
sven1977 721cfc9
merge
sven1977 58d7b11
wip
sven1977 78cd2b6
wip
sven1977 859d999
wip
sven1977 4d20fa2
wip
sven1977 87f38b7
wip
sven1977 f8c4c71
wip
sven1977 866fec3
wip
sven1977 c3ce9c9
wip
sven1977 7c41ef6
wip
sven1977 5ef2b8a
wip
sven1977 988980d
wip
sven1977 00aba6c
wip
sven1977 606c69c
wip
sven1977 3dda88e
wip
sven1977 37fbd31
wip
sven1977 05085c6
wip
sven1977 873e307
wip
sven1977 e984149
wip
sven1977 4caebe0
wip
sven1977 ed5928b
wip
sven1977 fe49364
Merge branch 'master' of https://github.com/ray-project/ray into gymn…
sven1977 b8f4fad
wip
sven1977 f24f94c
LINT
sven1977 f80ceee
merge
sven1977 ed2ccc2
LINT
sven1977 18baa94
wip
sven1977 2b8ebef
Merge branch 'master' of https://github.com/ray-project/ray into gymn…
sven1977 43fa608
wip
sven1977 10975a2
wip
sven1977 59fd88d
wip
sven1977 80ea98e
wip
sven1977 d113b64
wip
sven1977 b8183ca
wip
sven1977 f094723
wip
sven1977 70c71e5
wip
sven1977 264c836
wip
sven1977 ab7cab2
Merge branch 'master' of https://github.com/ray-project/ray into gymn…
sven1977 4ce8498
wip
sven1977 5536b4b
wip
sven1977 91112ce
add recording example etc
ArturNiederfahrenhorst ff77a3c
Add to CI deps file
ArturNiederfahrenhorst c3d7b2b
kick off CI again
ArturNiederfahrenhorst f817776
fix deps
ArturNiederfahrenhorst c1c34fb
Attempt to pin decorator
ArturNiederfahrenhorst f893c67
merge master
ArturNiederfahrenhorst 2ffcacd
Merge branch 'master' into removeataristuffaddrecorder
ArturNiederfahrenhorst 0439830
test ffmpeg upgrade
ArturNiederfahrenhorst File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
""" | ||
The following example demonstrates how to record videos of your agent's behavior. | ||
|
||
RLlib exposes the ability of the Gymnasium API to record videos. | ||
This is done internally by wrapping the environment with the | ||
gymnasium.wrappers.RecordVideo wrapper. You can also wrap your environment with this | ||
wrapper manually to record videos of your agent's behavior if RLlib's built-in | ||
video recording does not meet your needs. | ||
|
||
In order to run this example, please regard the following: | ||
- You must have moviepy installed (pip install moviepy) | ||
- You must have ffmpeg installed (system dependent, e.g. brew install ffmpeg) | ||
- moviepy must find ffmpeg -> https://github.com/Zulko/moviepy/issues/1158. | ||
- An environment can only be recorded if it can be rendered. For most environments, | ||
this can be achieved by setting the render_mode to 'rgb_array' in the environment | ||
config. See the gymnasium API for more information. | ||
""" | ||
|
||
# First, we create videos with default settings: | ||
from ray.rllib.algorithms.ppo import PPOConfig | ||
|
||
config = PPOConfig().environment( | ||
env="CartPole-v1", record=True, env_config={"render_mode": "rgb_array"} | ||
) | ||
|
||
# By default, videos will be saved to your experiment logs directory under | ||
# ~/ray_results. | ||
|
||
# Secondly, we create videos every 100 episodes:: | ||
config.environment(recording_interval=100) | ||
algo = config.build() | ||
algo.train() | ||
|
||
algo = config.build() | ||
algo.train() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This is not the original concern of the PR, but I believe that we should clear our sampler of such logic that distinguishes between environments. We are not transparent about this and user has to deepdive rllib to understand/modify what is going on here.