-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make dm_control an extra dependency (#828)
Because dm_control needs to be installed from vcs or tarball, garage cannot be directly installed in pipenv (see [this issue](pypa/pipenv#3396)). I've copied the example that used our dm_control wrapper, modified the original example to use gym, and modified the copy to clarify the extra dependency. I've also modified the `garage.env.dm_control` module to report a helpful error message if dm_control isn't found. `pip install garage[all]` will still install dm_control.
- Loading branch information
Showing
4 changed files
with
40 additions
and
7 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env python3 | ||
"""Example of how to load, step, and visualize an environment. | ||
This example requires that garage[dm_control] be installed. | ||
""" | ||
from garage.envs.dm_control import DmControlEnv | ||
|
||
# Construct the environment | ||
env = DmControlEnv.from_suite('walker', 'run') | ||
|
||
# Reset the environment and launch the viewer | ||
env.reset() | ||
env.render() | ||
|
||
# Step randomly until interrupted | ||
try: | ||
print('Press Ctrl-C to stop...') | ||
while True: | ||
env.step(env.action_space.sample()) | ||
env.render() | ||
except KeyboardInterrupt: | ||
print('Exiting...') | ||
env.close() |
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