Coder Social home page Coder Social logo

dm2gym's Introduction

dm2gym: Convert DeepMind Control Suite to OpenAI gym environments.

This repository contains a lightweight wrapper to convert DeepMind Control Suite to OpenAI gym environments.

Installation

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 .

Getting started

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)

What's new

  • 2019-10-18 (v0.2.0)

    • Sync to the latest API of DeepMind Control Suite
    • Support gym registration: create all dm_control environments via gym.make
  • 2019-04-14 (v0.1.0)

    • Initial release

Reference

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

Contributors

zuoxingdong avatar koulanurag avatar

Stargazers

Nikita Kachaev  avatar Dimitrios Kapetanios avatar  avatar Timilehin Owolabi avatar Zhaoming avatar Hriday Mehta avatar  avatar Sehee Min avatar Jan Margeta avatar  avatar Jamie Bayne avatar Eugene Rush avatar Moritz Zanger avatar Luis Mantilla avatar SUBHASH ACHUTHA avatar Quentin Gallouédec avatar Yunke Wang avatar Sander Tonkens avatar Arnaud A avatar naoto yoshida avatar Yizhou Yang avatar Chi Zhang avatar  avatar Chandandeep Singh avatar Jingen Chou | Jen-Yen Chang avatar Chiaki Hirayama avatar Davide Paglieri avatar Haobo Luo avatar mart avatar Justin Yuan avatar justiceli avatar Abhinav Gupta avatar Kris Wu avatar Yachen Kang avatar Shunsuke Wada avatar Matt Shaffer avatar Hiroki Furuta avatar Raffaello Camoriano avatar Arnaud Wanet avatar Bryan avatar Pingchuan Ma avatar gyunggyung avatar Shyam Sudhakaran avatar Rishabh Jangir avatar Haresh avatar Arash Tavakoli avatar Panagiotis Tigas avatar Jingwei Zhang avatar Norio Kosaka avatar Amr Kayid avatar  avatar Rohan Saphal avatar Felix Lau avatar Louis Kirsch avatar Aaron Snoswell avatar di avatar Diego Ferigo avatar Juan G. Victores avatar  avatar Ashish Gupta avatar Weixun Wang avatar Slice avatar Manav Choudhary avatar  avatar  avatar 爱可可-爱生活 avatar Moritz Schneider avatar Krishna Kannan Srinivasan avatar Kun Shao avatar Guillem DB avatar Wyatt Makedonski avatar Yasuhiro Fujita avatar Pranjal Tandon avatar Mihir Rana avatar bygreencn avatar Ilya Kostrikov avatar Márcio Porto avatar Rishabh Madan avatar Antonio Gomez Zamorano avatar Kashif Rasul avatar Qrh avatar LukeDong avatar  avatar Maks Sorokin avatar  avatar Pooyan Jamshidi avatar Yusuke Nakata avatar

Watchers

justiceli avatar  avatar  avatar

dm2gym's Issues

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!

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.