Code Monkey home page Code Monkey logo

dmc2gym's Introduction

OpenAI Gym wrapper for the DeepMind Control Suite.

A lightweight wrapper around the DeepMind Control Suite that provides the standard OpenAI Gym interface. The wrapper allows to specify the following:

  • Reliable random seed initialization that will ensure deterministic behaviour.
  • Setting from_pixels=True converts proprioceptive observations into image-based. In additional, you can choose the image dimensions, by setting height and width.
  • Action space normalization bound each action's coordinate into the [-1, 1] range.
  • Setting frame_skip argument lets to perform action repeat.

Instalation

pip install git+git://github.com/denisyarats/dmc2gym.git

Usage

import dmc2gym

env = dmc2gym.make(domain_name='point_mass', task_name='easy', seed=1)

done = False
obs = env.reset()
while not done:
  action = env.action_space.sample()
  obs, reward, done, info = env.step(action)

dmc2gym's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dmc2gym's Issues

python: /builds/florianrhiem/pyGLFW/glfw-3.3.7/src/posix_thread.c:64: _glfwPlatformGetTls: Assertion `tls->posix.allocated == 1' failed.

Getting this error

python: /builds/florianrhiem/pyGLFW/glfw-3.3.7/src/posix_thread.c:64: _glfwPlatformGetTls: Assertion `tls->posix.allocated == 1' failed.

when it gets to the env.render() function. Not sure what to do.

import dmc2gym

env = dmc2gym.make(domain_name='point_mass', task_name='easy', seed=1)

done = False
obs = env.reset()
while not done:
  action = env.action_space.sample()
  obs, reward, done, info = env.step(action)
  rgb_obs = env.render(mode='rgb_array')

Unable to install dmc2gym

Thank you for open sourcing dmc2gym. I have been using dmc2gym since last year, but after yesterday I am unable to install dmc2gym using the mentioned installation command-
pip install git+git://github.com/denisyarats/dmc2gym.git

It is showing the error-
error

I checked the mentioned link in the error message and found that Github has disabled support for unencrypted Git protocol (git://). What is the alternative way to install dmc2gym?

Request your help in this matter @denisyarats @bamos

Installation problem

Hi,
Provided installation command isn't working properly. It seems that it's unable to connect to github.com. I found an alternative solution from here which worked for me. Simply, I tried this: "pip install git+https://github.com/1nadequacy/dmc2gym.git" (https instead of git)

time_limit = None RunTime error

When running the example, we got the following bug:

import dmc2gym

env = dmc2gym.make(domain_name='point_mass', task_name='easy', seed=1)

done = False
obs = env.reset()
while not done:
    action = env.action_space.sample()
    obs, reward, done, info = env.step(action)

Error

/Users/ge/opt/anaconda3/envs/plan2vec/bin/python /Users/ge/fair/dm_control_suite_playground/dm_control_suite_playground/__init__.py
Traceback (most recent call last):
  File "/Users/ge/fair/dm_control_suite_playground/dm_control_suite_playground/__init__.py", line 3, in <module>
    env = dmc2gym.make(domain_name='point_mass', task_name='easy', seed=1)
  File "/Users/ge/fair/dmc2gym/dmc2gym/__init__.py", line 48, in make
    return gym.make(env_id)
  File "/Users/ge/opt/anaconda3/envs/plan2vec/lib/python3.6/site-packages/gym/envs/registration.py", line 156, in make
    return registry.make(id, **kwargs)
  File "/Users/ge/opt/anaconda3/envs/plan2vec/lib/python3.6/site-packages/gym/envs/registration.py", line 101, in make
    env = spec.make(**kwargs)
  File "/Users/ge/opt/anaconda3/envs/plan2vec/lib/python3.6/site-packages/gym/envs/registration.py", line 73, in make
    env = cls(**_kwargs)
  File "/Users/ge/fair/dmc2gym/dmc2gym/wrappers.py", line 64, in __init__
    environment_kwargs=environment_kwargs
  File "/Users/ge/opt/anaconda3/envs/plan2vec/lib/python3.6/site-packages/dm_control/suite/__init__.py", line 114, in load
    environment_kwargs, visualize_reward)
  File "/Users/ge/opt/anaconda3/envs/plan2vec/lib/python3.6/site-packages/dm_control/suite/__init__.py", line 148, in build_environment
    env = domain.SUITE[task_name](**task_kwargs)
  File "/Users/ge/opt/anaconda3/envs/plan2vec/lib/python3.6/site-packages/dm_control/suite/point_mass.py", line 49, in easy
    physics, task, time_limit=time_limit, **environment_kwargs)
  File "/Users/ge/opt/anaconda3/envs/plan2vec/lib/python3.6/site-packages/dm_control/rl/control.py", line 80, in __init__
    self._physics.timestep() * self._n_sub_steps)
TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'

Process finished with exit code 1

dmc2gym has no attribute 'env_specs'

Traceback (most recent call last):
File "/home/yang/dmcontrol-generalization-benchmark/src/train.py", line 150, in
main(args)
File "/home/yang/dmcontrol-generalization-benchmark/src/train.py", line 50, in main
mode='train'
File "/home/yang/dmcontrol-generalization-benchmark/src/env/wrappers.py", line 48, in make_env
background_dataset_paths=paths
File "/home/yang/dmcontrol-generalization-benchmark/src/env/dmc2gym/dmc2gym/init.py", line 36, in make
if not env_id in gym.envs.registry.env_specs:
AttributeError: 'dict' object has no attribute 'env_specs'

pip install does not work

Hi
The install command mentioned here does not work.

pip install git+git://github.com/denisyarats/dmc2gym.git
Collecting git+git://github.com/denisyarats/dmc2gym.git
  Cloning git://github.com/denisyarats/dmc2gym.git to /tmp/pip-req-build-ahuyx_q5
  Running command git clone -q git://github.com/denisyarats/dmc2gym.git /tmp/pip-req-build-ahuyx_q5
  fatal: unable to connect to github.com:
  github.com[0: 140.82.121.4]: errno=Connection timed out

WARNING: Discarding git+git://github.com/denisyarats/dmc2gym.git. Command errored out with exit status 128: git clone -q git://github.com/denisyarats/dmc2gym.git /tmp/pip-req-build-ahuyx_q5 Check the logs for full command output.
ERROR: Command errored out with exit status 128: git clone -q git://github.com/denisyarats/dmc2gym.git /tmp/pip-req-build-ahuyx_q5 Check the logs for full command output.

Is there any other way I build the package and install it on my system? Any help will be useful.

Thanks & Regards
Swagat

from_pixels doesn't work

import dmc2gym

env = dmc2gym.make(domain_name='point_mass', task_name='easy', from_pixels=True)

done = False
obs = env.reset()
while not done:
  action = env.action_space.sample()
  obs, reward, done, info = env.step(action)
~/anaconda3/envs/main/lib/python3.7/site-packages/dmc2gym/__init__.py in make(domain_name, task_name, seed, visualize_reward, from_pixels, height, width, camera_id, frame_skip, episode_length, environment_kwargs, time_limit, channels_first)
     21 
     22     if from_pixels:
---> 23         assert not visualize_reward, 'cannot use visualize reward when learning from pixels'
     24 
     25     # shorten episode length

AssertionError: cannot use visualize reward when learning from pixels

How can I fix it?

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.