This repository contains a lightweight wrapper to convert DeepMind Control Suite to OpenAI gym environments.
One can install directly from PyPI:
pip install dm2gym
The installation can also be done with:
git clone https://github.com/zuoxingdong/dm2gym.git
cd dm2gym
pip install -e .
One liner to create the environment:
import gym
env = gym.make('dm2gym:CheetahRun-v0')
More examples to specify the environment:
env = gym.make('dm2gym:FishSwim-v0', environment_kwargs={'flat_observation': True})
env = gym.make('dm2gym:HopperHop-v0', visualize_reward=True)
-
2019-10-18 (v0.2.0)
- Sync to the latest API of DeepMind Control Suite
- Support gym registration: create all
dm_control
environments viagym.make
-
2019-04-14 (v0.1.0)
- Initial release
Please use this bibtex if you want to cite this repository in your publications:
@misc{dm2gym,
author = {Zuo, Xingdong},
title = {dm2gym: Convert DeepMind Control Suite to OpenAI gym environments.},
year = {2019},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/zuoxingdong/dm2gym}},
}
dm2gym's People
dm2gym's Issues
Fix Box space: recast to np.float32 to avoid warning in gym 0.15.6
Update code on pypi for rendering fix?
Hi, it seems like the code on github has fixed a problem that is still an issue when downloading from pypi. The pypi has an incorrect import of OpenCVImageViewer
that this line fixes.
Not super familiar with how updates on pypi work, but hopefully it's just a matter of uploading a new copy? Thanks!
Is there a way to set the state of the simulation?
In our case this is needed for random sampling.
environment name is not camelcased correctly
import gym
env = gym.make("ManipulatorBringPeg-v0")
fails. The task name is bring_peg
.
ps: I am happy to submit a PR and/or co-maintain this repo.
pyglet.gl.lib.GLException: b'invalid enumerant'
Hi Xingdong, thanks for this great wrapper! This is exactly what I was looking for :)
I have discovered an OpenGL context bug in pyglet
that will cause gym.envs.classic_control.rendering.SimpleImageViewer
to crash every time under certain OpenGL driver configurations if dm_control
is currently being used to render scenes (e.g. I'm using Windows 10 64bit, Python 3.6.6, Pyglet 1.4.0b1 with a GeForce MX150 and driver version 430.39). This makes the dm2gym
wrapper unusable if doing human-mode rendering. This bug has been reported to the pyglet
team here and here but there isn't any known fix yet.
I'm creating an issue here for the bug because I've developed a patch for dm2gym
that adds an alternate rendering mode based on OpenCV that is performant and avoids this crashing bug. I'll send the PR shortly - hopefully we can work to get this merged into the repo :)
Thanks!
ImportError: cannot import name 'OpenCVImageViewer'
Hi @zuoxingdong,
I tried using your library and fell into following error while rendering the environment.
Code for Reproducing error:
Python 3.6.8 (default, Apr 25 2019, 21:02:35)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gym
>>> env = gym.make('dm2gym:CheetahRun-v0')
>>> env.reset()
OrderedDict([('position', array([-0.08983072, 0.02608368, -0.07039982, -0.02420361, -0.09786251,
0.00783717, 0.00086811, 0.01643009])), ('velocity', array([ 7.63741440e-03, -2.40066665e-03, 1.22002775e-03, 1.66245562e-02,
1.46398462e-02, 1.37561358e-02, -8.39381618e-05, -1.18232967e-02,
-8.87592611e-03]))])
>>> env.render(use_opencv_renderer=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "...<some_path>../lib64/python3.6/site-packages/gym/core.py", line 235, in render
return self.env.render(mode, **kwargs)
File "..<some_path>../dm2gym/dm2gym/envs/dm_suite_env.py", line 71, in render
from dm2gym import OpenCVImageViewer
ImportError: cannot import name 'OpenCVImageViewer'
I installed the package using following instructions:
git clone https://github.com/zuoxingdong/dm2gym.git
cd dm2gym
pip install -e .
Thanks,
Anurag
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.