Giter Club home page Giter Club logo

dm_control's Introduction

dm_control: Google DeepMind Infrastructure for Physics-Based Simulation.

Google DeepMind's software stack for physics-based simulation and Reinforcement Learning environments, using MuJoCo physics.

An introductory tutorial for this package is available as a Colaboratory notebook: Open In Colab

Overview

This package consists of the following "core" components:

  • dm_control.mujoco: Libraries that provide Python bindings to the MuJoCo physics engine.

  • dm_control.suite: A set of Python Reinforcement Learning environments powered by the MuJoCo physics engine.

  • dm_control.viewer: An interactive environment viewer.

Additionally, the following components are available for the creation of more complex control tasks:

If you use this package, please cite our accompanying publication:

@article{tunyasuvunakool2020,
         title = {dm_control: Software and tasks for continuous control},
         journal = {Software Impacts},
         volume = {6},
         pages = {100022},
         year = {2020},
         issn = {2665-9638},
         doi = {https://doi.org/10.1016/j.simpa.2020.100022},
         url = {https://www.sciencedirect.com/science/article/pii/S2665963820300099},
         author = {Saran Tunyasuvunakool and Alistair Muldal and Yotam Doron and
                   Siqi Liu and Steven Bohez and Josh Merel and Tom Erez and
                   Timothy Lillicrap and Nicolas Heess and Yuval Tassa},
}

Installation

Install dm_control from PyPI by running

pip install dm_control

Note: dm_control cannot be installed in "editable" mode (i.e. pip install -e).

While dm_control has been largely updated to use the pybind11-based bindings provided via the mujoco package, at this time it still relies on some legacy components that are automatically generated from MuJoCo header files in a way that is incompatible with editable mode. Attempting to install dm_control in editable mode will result in import errors like:

ImportError: cannot import name 'constants' from partially initialized module 'dm_control.mujoco.wrapper.mjbindings' ...

The solution is to pip uninstall dm_control and then reinstall it without the -e flag.

Versioning

Starting from version 1.0.0, we adopt semantic versioning.

Prior to version 1.0.0, the dm_control Python package was versioned 0.0.N, where N was an internal revision number that increased by an arbitrary amount at every single Git commit.

If you want to install an unreleased version of dm_control directly from our repository, you can do so by running pip install git+https://github.com/google-deepmind/dm_control.git.

Rendering

The MuJoCo Python bindings support three different OpenGL rendering backends: EGL (headless, hardware-accelerated), GLFW (windowed, hardware-accelerated), and OSMesa (purely software-based). At least one of these three backends must be available in order render through dm_control.

  • Hardware rendering with a windowing system is supported via GLFW and GLEW. On Linux these can be installed using your distribution's package manager. For example, on Debian and Ubuntu, this can be done by running sudo apt-get install libglfw3 libglew2.0. Please note that:

    • dm_control.viewer can only be used with GLFW.
    • GLFW will not work on headless machines.
  • "Headless" hardware rendering (i.e. without a windowing system such as X11) requires EXT_platform_device support in the EGL driver. Recent Nvidia drivers support this. You will also need GLEW. On Debian and Ubuntu, this can be installed via sudo apt-get install libglew2.0.

  • Software rendering requires GLX and OSMesa. On Debian and Ubuntu these can be installed using sudo apt-get install libgl1-mesa-glx libosmesa6.

By default, dm_control will attempt to use GLFW first, then EGL, then OSMesa. You can also specify a particular backend to use by setting the MUJOCO_GL= environment variable to "glfw", "egl", or "osmesa", respectively. When rendering with EGL, you can also specify which GPU to use for rendering by setting the environment variable MUJOCO_EGL_DEVICE_ID= to the target GPU ID.

Additional instructions for Homebrew users on macOS

  1. The above instructions using pip should work, provided that you use a Python interpreter that is installed by Homebrew (rather than the system-default one).

  2. Before running, the DYLD_LIBRARY_PATH environment variable needs to be updated with the path to the GLFW library. This can be done by running export DYLD_LIBRARY_PATH=$(brew --prefix)/lib:$DYLD_LIBRARY_PATH.

dm_control's People

Contributors

alimuldal avatar axnedergaard avatar dependabot[bot] avatar dyth avatar erez-tom avatar ethanluoyc avatar hartikainen avatar hawkinsp avatar hiwonjoon avatar jeanelsner avatar jjshoots avatar jsmereldm avatar kevinzakka avatar liusiqi43 avatar nimrod-gileadi avatar nsk126 avatar quagla avatar rchen152 avatar redwrasse avatar ryanjulian avatar saran-t avatar sbohez avatar siegeln avatar simipixel avatar vaxenburg avatar vittorione94 avatar wanghansolo avatar yilei avatar yotam avatar yuvaltassa avatar

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

dm_control's Issues

Request for acrobot swing up control solution

I'm trying to design a lqr controller along the optimal trajectory of the swing up task for acrobot. But the control solution I got by gradient descending cannot bring the acrobot close enough to the top position for my lqr controller to balance it. I'm wondering if you could provide the control solution for the acrobot swing up task? Thanks a lot!

Load task failed

Thanks for sharing this great work to us!

I was able to successfully import suite by running from dm_control import suite but when I run

env = suite.load(domain_name="pendulum", task_name="swingup")

I got

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/xxxx/.local/lib/python2.7/site-packages/dm_control/suite/__init__.py", line 110, in load
    visualize_reward)
  File "/home/xxxx/.local/lib/python2.7/site-packages/dm_control/suite/__init__.py", line 140, in build_environment
    env = domain.SUITE[task_name](**task_kwargs)
  File "/home/xxxx/.local/lib/python2.7/site-packages/dm_control/suite/pendulum.py", line 50, in swingup
    physics = Physics.from_xml_string(*get_model_and_assets())
  File "/home/xxxx/.local/lib/python2.7/site-packages/dm_control/mujoco/engine.py", line 344, in from_xml_string
    return cls.from_model(model)
  File "/home/xxxx/.local/lib/python2.7/site-packages/dm_control/mujoco/engine.py", line 327, in from_model
    return cls(data)
  File "/home/luoqi06/.local/lib/python2.7/site-packages/dm_control/mujoco/engine.py", line 120, in __init__
    self._reload_from_data(data)
  File "/home/xxxx/.local/lib/python2.7/site-packages/dm_control/mujoco/engine.py", line 306, in _reload_from_data
    render_context = render.Renderer(_MAX_WIDTH, _MAX_HEIGHT)
  File "/home/xxxx/.local/lib/python2.7/site-packages/dm_control/render/base.py", line 44, in __init__
    self._create(max_width, max_height)
  File "/home/xxxx/.local/lib/python2.7/site-packages/dm_control/render/glfw_renderer.py", line 44, in _create
    glfw.window_hint(glfw.DOUBLEBUFFER, 0)
  File "/home/xxxx/.local/lib/python2.7/site-packages/glfw.py", line 978, in window_hint
    _glfw.glfwWindowHint(target, hint)
  File "/home/xxxx/.local/lib/python2.7/site-packages/glfw.py", line 617, in errcheck
    _reraise(exc[1], exc[2])
  File "/home/xxxx/.local/lib/python2.7/site-packages/glfw.py", line 39, in _reraise
    raise (exception, None, traceback)
glfw.GLFWError: (65539) Invalid argument for enum parameter

Getting `glfw.GLFWError`

When loading any task, I'm consistently getting

glfw.GLFWError: (65543) b'GLX: Failed to create context: BadValue (integer parameter out of range for operation)'
Exception ignored in: <bound method Renderer.__del__ of <dm_control.render.glfw_renderer.GLFWRenderer object at 0x7f77ae4e8e48>>
Traceback (most recent call last):
  File "/home/anaconda3/lib/python3.6/site-packages/dm_control/render/base.py", line 110, in __del__
  File "/home/anaconda3/lib/python3.6/site-packages/dm_control/render/glfw_renderer.py", line 64, in free_context
AttributeError: 'GLFWRenderer' object has no attribute '_context'

My OS is Ubuntu 16.04, python 3.6. I installed libglfw from source as suggested by other users. I also installed libglew1.13 because libglew2.0 doesn't exist in apt-get on Ubuntu 16.04

Reward function returning 'Nonetype'

Hi!
I am running the 'swingup' task under the 'acrobot' model. I am randomly sampling a set of action inputs and evaluating the rewards. For some action inputs, I am getting a reward output of 'Nonetype'. So when I try to add the total reward I get the following exception
trew+=time_step.reward

TypeError: unsupported operand type(s) for +=: 'float' and 'NoneType

Has anyone else encountered this issue? Is there a way to resolve this?

NoneType' object has no attribute 'destroy_window'

Hi
I use the code in README.md, After I install mujoco and dm_control๏ผŒ when I run code ,it remind me th efollowing error:

Exception AttributeError: "'NoneType' object has no attribute 'destroy_window'" in <bound method GLFWContext.del of <dm_control.render.glfw_renderer.GLFWContext object at 0x7ffba109c110>> ignored

So I have to ask for your help ,

No OpenGL rendering backend

I am having the following trouble even though the requirement for installing dm_control is met.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/ais/gobi5/movie4d/conda_install/anaconda2/lib/python2.7/site-packages/dm_control/suite/__init__.py", line 110, in load
    visualize_reward)
  File "/ais/gobi5/movie4d/conda_install/anaconda2/lib/python2.7/site-packages/dm_control/suite/__init__.py", line 140, in build_environment
    env = domain.SUITE[task_name](**task_kwargs)
  File "/ais/gobi5/movie4d/conda_install/anaconda2/lib/python2.7/site-packages/dm_control/suite/cartpole.py", line 66, in swingup
    physics = Physics.from_xml_string(*get_model_and_assets())
  File "/ais/gobi5/movie4d/conda_install/anaconda2/lib/python2.7/site-packages/dm_control/mujoco/engine.py", line 344, in from_xml_string
    return cls.from_model(model)
  File "/ais/gobi5/movie4d/conda_install/anaconda2/lib/python2.7/site-packages/dm_control/mujoco/engine.py", line 327, in from_model
    return cls(data)
  File "/ais/gobi5/movie4d/conda_install/anaconda2/lib/python2.7/site-packages/dm_control/mujoco/engine.py", line 120, in __init__
    self._reload_from_data(data)
  File "/ais/gobi5/movie4d/conda_install/anaconda2/lib/python2.7/site-packages/dm_control/mujoco/engine.py", line 306, in _reload_from_data
    render_context = render.Renderer(_MAX_WIDTH, _MAX_HEIGHT)
  File "/ais/gobi5/movie4d/conda_install/anaconda2/lib/python2.7/site-packages/dm_control/render/__init__.py", line 51, in Renderer
    raise ImportError('No OpenGL rendering backend could be imported.')
ImportError: No OpenGL rendering backend could be imported.

ctypes constants.py not generated

Here is what I did when trying to install the package.

git clone <the github link>
# Change the DEFAULT_HEADERS_DIR in setup.py to my local include file (There isn't such option as headers-dir. I would be grateful if someone can point it to me how to use it)
# Set environment variables to MJKEY_PATH=<local path>/mjkey.txt
# Set environment variables to MJLIB_PATH=<local path>/bin
# I verified using echo command and it shows accordingly.
pip install .

Then when I try to run the tester code. I encounter the following error.

>>> from dm_control import suite
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "dm_control/suite/__init__.py", line 28, in <module>
    from dm_control.suite import acrobot
  File "dm_control/suite/acrobot.py", line 26, in <module>
    from dm_control import mujoco
  File "dm_control/mujoco/__init__.py", line 18, in <module>
    from dm_control.mujoco.engine import action_spec
  File "dm_control/mujoco/engine.py", line 43, in <module>
    from dm_control.mujoco import index
  File "dm_control/mujoco/index.py", line 94, in <module>
    from dm_control.mujoco.wrapper import util
  File "dm_control/mujoco/wrapper/__init__.py", line 23, in <module>
    from dm_control.mujoco.wrapper import mjbindings
  File "dm_control/mujoco/wrapper/mjbindings/__init__.py", line 24, in <module>
    from dm_control.mujoco.wrapper.mjbindings import constants
ImportError: cannot import name constants

I saw somewhere that it means that the mjbindings is not generated. But I use pip install . instead of pip install -e, so that shouldn't be the issue.
Can someone please help me here?

ImportError: cannot import name 'constants'

When I run this:

from dm_control import suite

The error occurs:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-2addf36a480e> in <module>()
----> 1 from dm_control import suite

~/ai-ink/Jupyter-zhouxin12/github/dm_control/dm_control/suite/__init__.py in <module>()
     26 from dm_control.rl import control
     27 
---> 28 from dm_control.suite import acrobot
     29 from dm_control.suite import ball_in_cup
     30 from dm_control.suite import cartpole

~/ai-ink/Jupyter-zhouxin12/github/dm_control/dm_control/suite/acrobot.py in <module>()
     24 # Internal dependencies.
     25 
---> 26 from dm_control import mujoco
     27 from dm_control.rl import control
     28 from dm_control.suite import base

~/ai-ink/Jupyter-zhouxin12/github/dm_control/dm_control/mujoco/__init__.py in <module>()
     16 """Mujoco implementations of base classes."""
     17 
---> 18 from dm_control.mujoco.engine import action_spec
     19 
     20 from dm_control.mujoco.engine import Camera

~/ai-ink/Jupyter-zhouxin12/github/dm_control/dm_control/mujoco/engine.py in <module>()
     41 
     42 from dm_control import render
---> 43 from dm_control.mujoco import index
     44 
     45 from dm_control.mujoco import wrapper

~/ai-ink/Jupyter-zhouxin12/github/dm_control/dm_control/mujoco/index.py in <module>()
     92 # Internal dependencies.
     93 
---> 94 from dm_control.mujoco.wrapper import util
     95 from dm_control.mujoco.wrapper.mjbindings import sizes
     96 import numpy as np

~/ai-ink/Jupyter-zhouxin12/github/dm_control/dm_control/mujoco/wrapper/__init__.py in <module>()
     21 
     22 
---> 23 from dm_control.mujoco.wrapper import mjbindings
     24 
     25 from dm_control.mujoco.wrapper.core import callback_context

~/ai-ink/Jupyter-zhouxin12/github/dm_control/dm_control/mujoco/wrapper/mjbindings/__init__.py in <module>()
     22 from absl import logging
     23 
---> 24 from dm_control.mujoco.wrapper.mjbindings import constants
     25 from dm_control.mujoco.wrapper.mjbindings import enums
     26 from dm_control.mujoco.wrapper.mjbindings import sizes

ImportError: cannot import name 'constants'

Segmentation Fault on checking mujoco licences

Hi all, thanks for open-sourcing such a great toolkit!
I would like to share and report a bug or issue in which segmentation fault occurs, which might also be happening for others.

>>> from dm_control import suite
>>> env = suite.load(domain_name="cartpole", task_name="swingup")
[1]    28081 segmentation fault (core dumped)  python

I found that it happens during verifying the mujoco license, say when we call _maybe_register_license() (and mjlib.mj_activate).

stacktrace on gdb:

#0  0x0000000000017946 in ?? ()
#1  0x00007ffff0a84fff in mjl_check () from $HOME/.mujoco/mjpro150/bin/libmujoco150.so
#2  0x00007ffff0a4c013 in mjl_activate () from $HOME/.mujoco/mjpro150/bin/libmujoco150.so
#3  0x00007ffff0a30e4d in mj_activate () from $HOME/mujoco/mjpro150/bin/libmujoco150.so
...

So the segfault happens when mj_activate from libmujoco150.so is invoked. I think it might be a problem of mujoco, not of this package; but maybe something can be wrong with auto-wrapping via ctypes. Plus, the test (python setup.py test) also fails with the same segmentation fault.

It happened on a linux 64bit machine (Ubuntu 14.04), with python 3.6 (anaconda) and 2.7.

I verified that mjkey.txt exists and the liecense worked well with mujoco C++ samples and OpenAI's mujoco-py.

GLEW initalization error ,it comes again

I updated dm_control(with viewer...) today.But when I run sample code in Quickstart, the error comes again.

>>> from dm_control import suite
>>> import numpy as np
>>> 
>>> # Load one task:
... env = suite.load(domain_name="cartpole", task_name="swingup")
>>> 
>>> # Iterate over a task set:
... for domain_name, task_name in suite.BENCHMARKING:
...   env = suite.load(domain_name, task_name)
... 
WARNING: Logging before flag parsing goes to stderr.
F1012 12:47:55.453529 140583399446272 core.py:93] **GLEW initalization error: Missing GL version**

However, it works well when I run sample code in "Interactive environment viewer".
I've reinstalled old "dm_control"package๏ผŒthe Quickstart run well(0 error,0 warning).
I'm so confused why the error comes again.๏ผˆWrite the issue for the first time, please enlighten me.๏ผ‰
(ubantu 16.04)

Request for a few new standard environments

It would be nice to add a few more standard environments, such as following:

  • Maze: spawn robot (Ant/Humanoid/Point mass) and the objective is to reach the goal
  • Gather: spawn robot (Ant/Humanoid/Point mass) and the objective is to collect green dots and avoid red dots.

These also make people life much easier to quickly adapt similar environments.

image
image

TypeError: expected str, bytes or os.PathLike object, not NoneType

I tried to install dm_control by pip install git+git://github.com/deepmind/dm_control.git.
However, I can import dm_control successfully, but when I used 'from dm_control import suite', error came.
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\bzdli\Anaconda3\envs\drl\lib\site-packages\dm_control\suite_init_.py", line 28, in
from dm_control.suite import acrobot
File "C:\Users\bzdli\Anaconda3\envs\drl\lib\site-packages\dm_control\suite\acrobot.py", line 26, in
from dm_control import mujoco
File "C:\Users\bzdli\Anaconda3\envs\drl\lib\site-packages\dm_control\mujoco_init_.py", line 18, in
from dm_control.mujoco.engine import action_spec
File "C:\Users\bzdli\Anaconda3\envs\drl\lib\site-packages\dm_control\mujoco\engine.py", line 43, in
from dm_control.mujoco import index
File "C:\Users\bzdli\Anaconda3\envs\drl\lib\site-packages\dm_control\mujoco\index.py", line 94, in
from dm_control.mujoco.wrapper import util
File "C:\Users\bzdli\Anaconda3\envs\drl\lib\site-packages\dm_control\mujoco\wrapper_init_.py", line 23, in
from dm_control.mujoco.wrapper import mjbindings
File "C:\Users\bzdli\Anaconda3\envs\drl\lib\site-packages\dm_control\mujoco\wrapper\mjbindings_init_.py", line 28, in
from dm_control.mujoco.wrapper.mjbindings import wrappers
File "C:\Users\bzdli\Anaconda3\envs\drl\lib\site-packages\dm_control\mujoco\wrapper\mjbindings\wrappers.py", line 14, in
from dm_control.mujoco.wrapper import util
File "C:\Users\bzdli\Anaconda3\envs\drl\lib\site-packages\dm_control\mujoco\wrapper\util.py", line 57, in
"~/.mujoco/mjpro150/bin", _get_shared_library_filename())
File "C:\Users\bzdli\Anaconda3\envs\drl\lib\site-packages\dm_control\mujoco\wrapper\util.py", line 47, in _get_shared_library_filename
libc_filename = os.path.split(libc_path)[1]
File "C:\Users\bzdli\Anaconda3\envs\drl\lib\ntpath.py", line 204, in split
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType

I's using windows 10 and python 3.6. Can someone figure this out?

How to add new objects in one domain or environment?

For example, in the domain Point-mass, which is introduced in your thesis "DeepMind Control Suite", I want to add a new collision point near the target, which works like a trap, every time when the moving point touches this collision point, it will get a negative reward -1.

As a result, I can finally train an agent, who can not only reach the desired target but also avoid the possible collisions when planning the path. The idea is like in a factory, there are not only robots but also human workers, and when the robot do some tasks, it shall avoid the collision and hurting humans.

I tried to modify the XML file to add the point, but it appears as only a static point in the GUI and the agent just ignores it, because I do not know how to specify a negative reward for this point. And btw, I want to make this point dynamic, just like a walking human.

I would be really grateful if you can offer some documentation or tutorials about how to create new objects in an existing environment or totally creating a new environment.

name 'MJVFS' is not defined

After installing dm_control I'm trying to import the suite but get the NameError name 'MJVFS' is not defined.
The traceback of the error is the following:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-4-d13180c61340> in <module>()
----> 1 from dm_control import suite

~/anaconda3/lib/python3.6/site-packages/dm_control/suite/__init__.py in <module>()
     26 from dm_control.rl import control
     27 
---> 28 from dm_control.suite import acrobot
     29 from dm_control.suite import ball_in_cup
     30 from dm_control.suite import cartpole

~/anaconda3/lib/python3.6/site-packages/dm_control/suite/acrobot.py in <module>()
     24 # Internal dependencies.
     25 
---> 26 from dm_control import mujoco
     27 from dm_control.rl import control
     28 from dm_control.suite import base

~/anaconda3/lib/python3.6/site-packages/dm_control/mujoco/__init__.py in <module>()
     16 """Mujoco implementations of base classes."""
     17 
---> 18 from dm_control.mujoco.engine import action_spec
     19 
     20 from dm_control.mujoco.engine import Camera

~/anaconda3/lib/python3.6/site-packages/dm_control/mujoco/engine.py in <module>()
     41 
     42 from dm_control import render
---> 43 from dm_control.mujoco import index
     44 
     45 from dm_control.mujoco import wrapper

~/anaconda3/lib/python3.6/site-packages/dm_control/mujoco/index.py in <module>()
     92 # Internal dependencies.
     93 
---> 94 from dm_control.mujoco.wrapper import util
     95 from dm_control.mujoco.wrapper.mjbindings import sizes
     96 import numpy as np

~/anaconda3/lib/python3.6/site-packages/dm_control/mujoco/wrapper/__init__.py in <module>()
     23 from dm_control.mujoco.wrapper import mjbindings
     24 
---> 25 from dm_control.mujoco.wrapper.core import callback_context
     26 
     27 from dm_control.mujoco.wrapper.core import Error

~/anaconda3/lib/python3.6/site-packages/dm_control/mujoco/wrapper/core.py in <module>()
     32 from dm_control.mujoco.wrapper.mjbindings import constants
     33 from dm_control.mujoco.wrapper.mjbindings import enums
---> 34 from dm_control.mujoco.wrapper.mjbindings import functions
     35 from dm_control.mujoco.wrapper.mjbindings import mjlib
     36 from dm_control.mujoco.wrapper.mjbindings import types

~/anaconda3/lib/python3.6/site-packages/dm_control/mujoco/wrapper/mjbindings/functions.py in <module>()
     85   None
     86 """
---> 87 mjlib.mj_defaultVFS.argtypes = [ctypes.POINTER(MJVFS)]
     88 mjlib.mj_defaultVFS.restype = None
     89 

NameError: name 'MJVFS' is not defined

MJVFS seems to be missing from dm_control.mujoco.wrapper.mjbindings.types.py.

I downloaded mjpro150 which is placed in ~/.mujoco/ as ~/.mujoco/mjpro150.
I also have mjpro131 in the same folder (~/.mujoco/mjpro131).

I have a student license in ~/.mujoco/mjkey.txt

I get no errors or warnings when installing dm_control.

mjpro131 works fine with mujoco-py and openai gym.

Its getting late over here so I might not be able to answer until tomorrow!

Attaching the file dm_control/mujoco/wrapper/mjbindings/types.py as a .txt file:
types.txt

How to test/run OpenGL visualization?

Hi,

I installed dm_control yesterday on an Ubuntu 16.04LTS system with NVIDIA graphics card. I have already installed --and work with-- mjpro150 and 131 (both mujoco-py and custom C++ interface) so I know those work fine.

I created the following "quickstart" script, using the provided one in the README:

import numpy as np
from dm_control import suite
# Load one task:
env = suite.load(domain_name="humanoid", task_name="stand", visualize_reward=True)
# Iterate over a task set:
for domain_name, task_name in suite.BENCHMARKING:
    env = suite.load(domain_name, task_name)
# Reset data
action_spec = env.action_spec()
time_step = env.reset()
# Step through an episode and print out reward, discount and observation.
while not time_step.last():
    action = np.random.uniform(action_spec.minimum,
                             action_spec.maximum,
                             size=action_spec.shape)
    time_step = env.step(action)
    pixels = env.physics.render()
    print(time_step.reward, time_step.discount, time_step.observation)

It "seems" to run since the print() call in the loop does indeed output such as:

0.9902381173079999 1.0 OrderedDict([('orientations', array([ 0.92190494, -0.38741616,  0.75086908, -0.66045108,  0.34782824,
        0.93755827,  0.01050299,  0.99994484, -0.34440243, -0.93882211,
       -0.02782136, -0.99961291,  0.52972116, -0.84817185])), ('height', 1.2930647420729058), ('velocity', array([ -0.49068857,   0.54707421,   2.52160751,   4.02860209,
        -1.37774209,  -4.43418408,   9.91898924, -14.24762728,
         0.23987449]))])

However, the MuJoCo OpenGL visualization never starts.

To get set-up, I created a virtualenv environment from scratch with python 3.5.2 as default (via PyCharm).

Also, I have to report that there is no Ubuntu package for libglew2.0 via apt-get on 16.04LTS. I had to download it from here and I not sure if this was the proper solution. I would appreciate it if someone who got it to work on Ubuntu 16.04 can report their steps.

Cheers,

Vassilios

Got "undefined symbol" When Importing suite

Hi, there!

I followed the installation instructions and installed the package successfully. But when I did from dm_control import suite, I got an error like this:

>>> from dm_control import suite
WARNING: Logging before flag parsing goes to stderr.
W0103 17:33:16.675210 140177339770624 __init__.py:35] mjbindings failed to import mjlib and other functions. libmujoco.so may not be accessible.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/zeyu/anaconda3/envs/mujoco/lib/python3.5/site-packages/dm_control/suite/__init__.py", line 28, in <module>
    from dm_control.suite import acrobot
  File "/home/zeyu/anaconda3/envs/mujoco/lib/python3.5/site-packages/dm_control/suite/acrobot.py", line 26, in <module>
    from dm_control import mujoco
  File "/home/zeyu/anaconda3/envs/mujoco/lib/python3.5/site-packages/dm_control/mujoco/__init__.py", line 18, in <module>
    from dm_control.mujoco.engine import action_spec
  File "/home/zeyu/anaconda3/envs/mujoco/lib/python3.5/site-packages/dm_control/mujoco/engine.py", line 43, in <module>
    from dm_control.mujoco import index
  File "/home/zeyu/anaconda3/envs/mujoco/lib/python3.5/site-packages/dm_control/mujoco/index.py", line 94, in <module>
    from dm_control.mujoco.wrapper import util
  File "/home/zeyu/anaconda3/envs/mujoco/lib/python3.5/site-packages/dm_control/mujoco/wrapper/__init__.py", line 25, in <module>
    from dm_control.mujoco.wrapper.core import callback_context
  File "/home/zeyu/anaconda3/envs/mujoco/lib/python3.5/site-packages/dm_control/mujoco/wrapper/core.py", line 34, in <module>
    from dm_control.mujoco.wrapper.mjbindings import functions
  File "/home/zeyu/anaconda3/envs/mujoco/lib/python3.5/site-packages/dm_control/mujoco/wrapper/mjbindings/functions.py", line 22, in <module>
    mjlib = util.get_mjlib()
  File "/home/zeyu/anaconda3/envs/mujoco/lib/python3.5/site-packages/dm_control/mujoco/wrapper/util.py", line 96, in get_mjlib
    return ctypes.cdll.LoadLibrary(_get_full_path(raw_path))
  File "/home/zeyu/anaconda3/envs/mujoco/lib/python3.5/ctypes/__init__.py", line 429, in LoadLibrary
    return self._dlltype(name)
  File "/home/zeyu/anaconda3/envs/mujoco/lib/python3.5/ctypes/__init__.py", line 351, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /home/zeyu/.mujoco/mjpro150/bin/libmujoco150.so: undefined symbol: __glewBlitFramebuffer

I tried to test Mujoco independently by runing $HOME/.mujoco/mjpro150/bin/simulate and it worked well.
My OS is Ubuntu 16.04 and I am using Python 3.5.4.
Can anyone help me with this?

Thanks a lot!

what does "mean return" mean in the tech report?

Hi,

Does it mean the reward of every episode? Besides, is it normal that ddpg algorithm can only successfully learn how to stand in the humanoid run environment given different seeds? Thanks.

Rendering and Saving

Is there an easy way of rendering and saving the screens as videos like a wrapper in gym environments?
env = SomeWrapper(save_loc="path") and env.render()

Returned observations will be mutated when the environment steps.

from dm_control import suite
import numpy as np

env = suite.load(domain_name="cartpole", task_name="swingup")
action_spec = env.action_spec()
action = np.random.uniform(action_spec.minimum,
                             action_spec.maximum,
                             size=action_spec.shape)
time_step = env.step(action)
obs = time_step.observation['velocity']
print('obs', obs)
for i in range(10):
    time_step = env.step(action)
print('obs', obs)
print('obs_new', time_step.observation['velocity'])

Gives

obs [-0.00617124  0.00592542]
obs [0.65594909 0.9535503 ]
obs_new [0.65594909 0.9535503 ]

So if I obtain observation from the environment, the array will be mutated when the environment steps. I believe that this behavior can cause a lot of trouble for people.
It would be great if something like copy(qvel) can be added instead.

Error when importing suite

I just installed dm_control and mujoco on windows, and I have the key located both in ~/.mujoco as dm_control requires and in mjpro150/bin as mujoco requires. During installation I got no errors or warnings. However, when I try to import dm_control I get the following error; can someone help me?

I verified that MuJoCo works, the simulations run on my computer just fine.

I am using python 3.5

from dm_control import suite

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-b0d6643feb1d> in <module>()
----> 1 from dm_control import suite

C:\Users\Niels\Anaconda3\envs\tf\lib\site-packages\dm_control\suite\__init__.py in <module>()
     26 from dm_control.rl import control
     27 
---> 28 from dm_control.suite import acrobot
     29 from dm_control.suite import ball_in_cup
     30 from dm_control.suite import cartpole

C:\Users\Niels\Anaconda3\envs\tf\lib\site-packages\dm_control\suite\acrobot.py in <module>()
     24 # Internal dependencies.
     25 
---> 26 from dm_control import mujoco
     27 from dm_control.rl import control
     28 from dm_control.suite import base

C:\Users\Niels\Anaconda3\envs\tf\lib\site-packages\dm_control\mujoco\__init__.py in <module>()
     16 """Mujoco implementations of base classes."""
     17 
---> 18 from dm_control.mujoco.engine import action_spec
     19 
     20 from dm_control.mujoco.engine import Camera

C:\Users\Niels\Anaconda3\envs\tf\lib\site-packages\dm_control\mujoco\engine.py in <module>()
     41 
     42 from dm_control import render
---> 43 from dm_control.mujoco import index
     44 
     45 from dm_control.mujoco import wrapper

C:\Users\Niels\Anaconda3\envs\tf\lib\site-packages\dm_control\mujoco\index.py in <module>()
     92 # Internal dependencies.
     93 
---> 94 from dm_control.mujoco.wrapper import util
     95 from dm_control.mujoco.wrapper.mjbindings import sizes
     96 import numpy as np

C:\Users\Niels\Anaconda3\envs\tf\lib\site-packages\dm_control\mujoco\wrapper\__init__.py in <module>()
     21 
     22 
---> 23 from dm_control.mujoco.wrapper import mjbindings
     24 
     25 from dm_control.mujoco.wrapper.core import callback_context

C:\Users\Niels\Anaconda3\envs\tf\lib\site-packages\dm_control\mujoco\wrapper\mjbindings\__init__.py in <module>()
     26 from dm_control.mujoco.wrapper.mjbindings import sizes
     27 from dm_control.mujoco.wrapper.mjbindings import types
---> 28 from dm_control.mujoco.wrapper.mjbindings import wrappers
     29 
     30 # pylint: disable=g-import-not-at-top

C:\Users\Niels\Anaconda3\envs\tf\lib\site-packages\dm_control\mujoco\wrapper\mjbindings\wrappers.py in <module>()
     12 # pylint: disable=undefined-variable
     13 # pylint: disable=wildcard-import
---> 14 from dm_control.mujoco.wrapper import util
     15 from dm_control.mujoco.wrapper.mjbindings.types import *
     16 

C:\Users\Niels\Anaconda3\envs\tf\lib\site-packages\dm_control\mujoco\wrapper\util.py in <module>()
     55 
     56 DEFAULT_MJLIB_PATH = os.path.join(
---> 57     "~/.mujoco/mjpro150/bin", _get_shared_library_filename())
     58 DEFAULT_MJKEY_PATH = "~/.mujoco/mjkey.txt"
     59 

C:\Users\Niels\Anaconda3\envs\tf\lib\site-packages\dm_control\mujoco\wrapper\util.py in _get_shared_library_filename()
     45   try:
     46     libc_path = ctypes.util.find_library("c")
---> 47     libc_filename = os.path.split(libc_path)[1]
     48     prefix = "lib" if libc_filename.startswith("lib") else ""
     49     extension = libc_filename.split(".")[1]

C:\Users\Niels\Anaconda3\envs\tf\lib\ntpath.py in split(p)
    202 
    203     seps = _get_bothseps(p)
--> 204     d, p = splitdrive(p)
    205     # set i to index beyond p's last slash
    206     i = len(p)

C:\Users\Niels\Anaconda3\envs\tf\lib\ntpath.py in splitdrive(p)
    137 
    138     """
--> 139     if len(p) >= 2:
    140         if isinstance(p, bytes):
    141             sep = b'\\'

TypeError: object of type 'NoneType' has no len()

solution: Don't use windows

potentially wrong condim in humanoid xml in the branch "merel_2017_humanoid"

Hi guys,
Thanks so much for sharing the CMU humanoid used in Merel et al 2017 (and making a new branch accordingly).

But I am not sure why you guys set the condim to be 1 in line 11 in dm_control/suite/humanoid_CMU.xml.
According to mojuco's modeling doc, "
1 | Frictionless contact.
3 | Regular frictional contact, opposing slip in the tangent plane.
4 | Frictional contact, opposing slip in the tangent plane and rotation around the contact normal. This is useful for modeling soft contacts (independent of contact penetration).
6 | Frictional contact, opposing slip in the tangent plane, rotation around the contact normal and rotation around the two axes of the tangent plane. The latter frictional effects are useful for preventing objects from indefinite rolling.
"

I believe condim should always be fixed to 3, otherwise you get something like this:
https://youtu.be/c0qgCsXuLYo

thanks in advance
best regards

the meaning of "action"

in the following code:

env = suite.load('humanoid', 'run')
spec = env.action_spec()
env.reset()
for _ in range(1000):
action = np.random.uniform(spec.minimum, spec.maximum, spec.shape)
env.step(action)
pixels = env.physics.render()

"action" is a ndarray of float64, i want to know, what's the meaning of the numbers in action, it is the joints' position, orientation, velocity, rotation or something else? If i know the ndarray of action, how can i get the state in next time step?

thank in advance

How many time steps are needed to see the action achieved?

For example, in the README example with cartpole and swingup, I do not see the action achieved with 10 time steps. Do you have any documentation on how long different tasks take, or at what time step the results in the Youtube video happened?

New domain and task

Suppose I would like to write my own domain and task.

I copied humanoid.xml and humanoid.py, renamed to the same name and also in all occurrence in those files. I included init.py from suite and added import for the new suit I just copied.

Since there is no proper documentation I assume making this as playground is the best, right? I know I can register Gym environments in init.py very easily. Is there any way how to develop my own domain and task? Thank you!

Can't import viewer on Arch Linux

Every time I try to from dm_control import viewer, Python throws the follow error

>>> from dm_control import viewer
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "PYTHON_INSTALLATION/lib/python3.7/site-packages/dm_control/viewer/__init__.py", line 22, in <module>
    from dm_control.viewer import application
  File "PYTHON_INSTALLATION/lib/python3.7/site-packages/dm_control/viewer/application.py", line 23, in <module>
    from dm_control import render
  File "PYTHON_INSTALLATION/lib/python3.7/site-packages/dm_control/render/__init__.py", line 62, in <module>
    Renderer = import_func()
  File "PYTHON_INSTALLATION/lib/python3.7/site-packages/dm_control/render/__init__.py", line 38, in _import_osmesa
    from dm_control.render.pyopengl.osmesa_renderer import OSMesaContext
  File "PYTHON_INSTALLATION/lib/python3.7/site-packages/dm_control/render/pyopengl/osmesa_renderer.py", line 41, in <module>
    from OpenGL import GL
  File "PYTHON_INSTALLATION/lib/python3.7/site-packages/OpenGL/GL/__init__.py", line 4, in <module>
    from OpenGL.GL.VERSION.GL_1_1 import *
  File "PYTHON_INSTALLATION/lib/python3.7/site-packages/OpenGL/GL/VERSION/GL_1_1.py", line 14, in <module>
    from OpenGL.raw.GL.VERSION.GL_1_1 import *
  File "PYTHON_INSTALLATION/lib/python3.7/site-packages/OpenGL/raw/GL/VERSION/GL_1_1.py", line 7, in <module>
    from OpenGL.raw.GL import _errors
  File "PYTHON_INSTALLATION/lib/python3.7/site-packages/OpenGL/raw/GL/_errors.py", line 4, in <module>
    _error_checker = _ErrorChecker( _p, _p.GL.glGetError )
  File "PYTHON_INSTALLATION/lib/python3.7/ctypes/__init__.py", line 369, in __getattr__
    func = self.__getitem__(name)
  File "PYTHON_INSTALLATION/lib/python3.7/ctypes/__init__.py", line 374, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/libOSMesa.so.8: undefined symbol: glGetError

which seems to be caused by PyOpenGL's incompatibility with mesa-18.2.3-1 on Arch Linux. I've open an issue on PyOpenGL here: mcfletch/pyopengl#18
but I'm wondering if anyone else has run into this issue. If so, how did you get around it?

Can't launch the viewer

I am getting the following for the viewer.launch(env) function.

Traceback (most recent call last):
  File "/home/tarik/dm_test.py", line 8, in <module>
    viewer.launch(env)
  File "/home/tarik/develop/py-envs/rl/local/lib/python2.7/site-packages/dm_control/viewer/__init__.py", line 42, in launch
    app = application.Application(title=title, width=width, height=height)
  File "/home/tarik/develop/py-envs/rl/local/lib/python2.7/site-packages/dm_control/viewer/application.py", line 191, in __init__
    self._window = gui.RenderWindow(width, height, title)
  File "/home/tarik/develop/py-envs/rl/local/lib/python2.7/site-packages/dm_control/viewer/gui/__init__.py", line 35, in ErrorRenderWindow
    'Cannot create a window because no windowing system could be imported')
ImportError: Cannot create a window because no windowing system could be imported
Exception RuntimeError: RuntimeError('This executor has already been terminated.',) in <function callback at 0x7f106b5350c8> ignored

I belive osmesa is currently being used:

In [2]: render.BACKEND
Out[2]: 'osmesa'

My setup is Ubuntu 16.04, Python 2.7 with virtualenv.

PS. MuJoCo by itsel works fine.

Extending mjbindings with custom mj extensions?

Has anyone at DM tried extending mjbindings with their own MuJoCo extensions, since this seems like a very natural place to put them? I tried to add my own header file to the list of headers that setup.py scans from ~/.mujoco/mjpro150/includes. The header contains:

#pragma once

// this is a C-API
#if defined(__cplusplus)
extern "C" {
#endif

#include "mujoco.h"

// Test extension.
MJAPI void my_mj_test(const mjModel* m);

#if defined(__cplusplus)
}
#endif

Now I get the following error as expected:

>>> from dm_control.mujoco.wrapper.mjbindings import functions
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/efagerho/anaconda3/envs/mjtest/lib/python3.6/site-packages/dm_control/mujoco/__init__.py", line 18, in <module>
    from dm_control.mujoco.engine import action_spec
  File "/home/efagerho/anaconda3/envs/mjtest/lib/python3.6/site-packages/dm_control/mujoco/engine.py", line 43, in <module>
    from dm_control.mujoco import index
  File "/home/efagerho/anaconda3/envs/mjtest/lib/python3.6/site-packages/dm_control/mujoco/index.py", line 94, in <module>
    from dm_control.mujoco.wrapper import util
  File "/home/efagerho/anaconda3/envs/mjtest/lib/python3.6/site-packages/dm_control/mujoco/wrapper/__init__.py", line 23, in <module>
    from dm_control.mujoco.wrapper import mjbindings
  File "/home/efagerho/anaconda3/envs/mjtest/lib/python3.6/site-packages/dm_control/mujoco/wrapper/mjbindings/__init__.py", line 32, in <module>
    from dm_control.mujoco.wrapper.mjbindings import functions
  File "/home/efagerho/anaconda3/envs/mjtest/lib/python3.6/site-packages/dm_control/mujoco/wrapper/mjbindings/functions.py", line 33, in <module>
    """
  File "/home/efagerho/anaconda3/envs/mjtest/lib/python3.6/ctypes/__init__.py", line 361, in __getattr__
    func = self.__getitem__(name)
  File "/home/efagerho/anaconda3/envs/mjtest/lib/python3.6/ctypes/__init__.py", line 366, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /home/efagerho/.mujoco/mjpro150/bin/libmujoco150.so: undefined symbol: my_mj_test

I was wondering what would be the easiest way to make the wrapper load my custom shared object if I dump that in the same directory as libmujoco150.so?

Reacher observation contains constant element

import numpy as np
from dm_control import suite

env = suite.load('reacher', 'easy')
action_spec = env.action_spec()
time_step = env.reset()
while not time_step.last():
  print(time_step.observation['to_target'][2])  # Always 0; possibly z coordinate?
  action = np.random.uniform(action_spec.minimum, action_spec.maximum, action_spec.shape)
  time_step = env.step(action)

Batched environments?

Has there been any plans to support batched environments, where the environment runs parallel simulations or is the idea to just let the user manage manage a set of environments?

How reacher environment calculates reward

Hi,

I wonder how the reacher environment computes the rewards.
I have found the following codes in reacher.py

def get_reward(self, physics):
    radii = physics.named.model.geom_size[['target', 'finger'], 0].sum()
    return rewards.tolerance(physics.finger_to_target_dist(), (0, radii))

So essentially it is the distance between the target and the finger.
But when I was running a piece of sample codes.

    env = suite.load(domain_name='reacher', task_name='hard')
    action_spec = env.action_spec()
    time_step = env.reset()
    while not time_step.last():
        action = np.random.uniform(action_spec.minimum,
                                   action_spec.maximum,
                                   size=action_spec.shape)
        time_step = env.step(action)
        print(time_step.reward)

Thanks in advance!

Comparison of benchmarking results

In the tech report, there are two tables that provide benchmark scores for the different environments, provided by a couple of different algorithms. Whilst this is a good starting point for comparing techniques, it would be useful an online system for comparing results.

A couple of ideas spring to mind:

  1. A results table in the wiki section of this repository. Users would list their scores along with a write up and evidence. This would need clear instructions of the conditions in which to evaluate an agent (episode length, episode repeats, limit on training frames/time etc.).
  2. An automated system for evaluating agents - submit some code that takes actions in an environment based on the presented observations. This would allow for consistent reporting and comparison of results, but is more complex than the first option.

How to render?

There is a render module but I don't know how to use it. Could you please provide some examples of how to render?

Model used to train the agent

I'm trying to train a custom agent to learn how to swim in one of the environments provided by this repo using deep Q learning. However, I'm not sure how to get around the fact that the action space is continuous and the observation space is a dictionary of arrays, since all the deep Q models I've looked at initialize their num_actions and num_states variables as follows:

num_actions = env.action_space.shape[0] num_states = env.observation_space.shape[0]

Is there some other way to train this model using action_spec() and observation_spec()? If so, are there examples that I can look at?

Thanks!

Scale of observation space

Is there a possibility to get the max and min of observations. This would be very helpful in scaling the observations before feeding to the networks. We can add this to env.observation_spec() ? Another possibility would be provide env.observation_samples() which provide some sample data points so that the user can fit a scaler object.

Segmentation fault when importing dm_control before TensorFlow

Importing TensorFlow and then dm_control works:

$ python3 -Xfaulthandler -c 'import tensorflow; from dm_control import suite; print("Done")'
Done

Importing dm_control and then TensorFlow (the alphabetical order) results in a segfault:

$ python3 -Xfaulthandler -c 'from dm_control import suite; import tensorflow; print("Done")'                                                                              
Fatal Python error: Segmentation fault

Current thread 0x00007f0b6fa72700 (most recent call first):
  File "<frozen importlib._bootstrap>", line 222 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 914 in create_module
  File "<frozen importlib._bootstrap>", line 577 in module_from_spec
  File "<frozen importlib._bootstrap>", line 666 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 693 in _load
  File "/usr/lib/python3.5/imp.py", line 342 in load_dynamic
  File "/usr/lib/python3.5/imp.py", line 242 in load_module
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24 in swig_import_helper
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28 in <module>
  File "<frozen importlib._bootstrap>", line 222 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 673 in exec_module
  File "<frozen importlib._bootstrap>", line 673 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 958 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 969 in _find_and_load
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58 in <module>
  File "<frozen importlib._bootstrap>", line 222 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 673 in exec_module
  File "<frozen importlib._bootstrap>", line 673 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 958 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 969 in _find_and_load
  File "<frozen importlib._bootstrap>", line 222 in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1016 in _handle_fromlist
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/__init__.py", line 49 in <module>
  File "<frozen importlib._bootstrap>", line 222 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 673 in exec_module
  File "<frozen importlib._bootstrap>", line 673 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 958 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 969 in _find_and_load
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/__init__.py", line 24 in <module>
  File "<frozen importlib._bootstrap>", line 222 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 673 in exec_module
  File "<frozen importlib._bootstrap>", line 673 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 958 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 969 in _find_and_load
  File "<string>", line 1 in <module>
zsh: segmentation fault  python3 -Xfaulthandler -c

I've replicated this on my Debian 9 machine (Google workstation) with Python versions 2.7, 3.5, 3.6 and TensorFlow versions 1.4.1 and 1.5.0 with GPU support. I'm using the current master branch of the repository.

import MuJoCo, ImportError: cannot import name 'constants'

Dear all:
when I import MuJoCo, some error happen:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-7bf9adbdec98> in <module>()
----> 1 import dm_control.mujoco

/Users/codeMan/Documents/py-lab/dm_control/dm_control/mujoco/__init__.py in <module>()
     16 """Mujoco implementations of base classes."""
     17
---> 18 from dm_control.mujoco.engine import action_spec
     19
     20 from dm_control.mujoco.engine import Camera

/Users/codeMan/Documents/py-lab/dm_control/dm_control/mujoco/engine.py in <module>()
     41
     42 from dm_control import render
---> 43 from dm_control.mujoco import index
     44
     45 from dm_control.mujoco import wrapper

/Users/codeMan/Documents/py-lab/dm_control/dm_control/mujoco/index.py in <module>()
     92 # Internal dependencies.
     93
---> 94 from dm_control.mujoco.wrapper import util
     95 from dm_control.mujoco.wrapper.mjbindings import sizes
     96 import numpy as np

/Users/codeMan/Documents/py-lab/dm_control/dm_control/mujoco/wrapper/__init__.py in <module>()
     21
     22
---> 23 from dm_control.mujoco.wrapper import mjbindings
     24
     25 from dm_control.mujoco.wrapper.core import callback_context

/Users/codeMan/Documents/py-lab/dm_control/dm_control/mujoco/wrapper/mjbindings/__init__.py in <module>()
     22 from absl import logging
     23
---> 24 from dm_control.mujoco.wrapper.mjbindings import constants
     25 from dm_control.mujoco.wrapper.mjbindings import enums
     26 from dm_control.mujoco.wrapper.mjbindings import sizes

ImportError: cannot import name 'constants'

My python version is Python 3.5.3, and I use macOs sierra 10.12.6

SegFault on loading an environment

'''

from dm_control import suite
env = suite.load(domain_name='cartpole', task_name='swingup')
Segmentation fault (core dumped)
'''

I can import a suite but cannot load a testing environment.

Position and velocity in cheetah environment

Why is the position in cheetah is of dim 8 but the velocity is of dim 9? And what do they denote?
Are they 3d position of joints? Documentation of observation for all the environments would be very helpful in general.

Tracking cameras?

Hi,

Each time that I visualize the hooper-hop or walker-walk domains-tasks, for example, I notice that the agents easily escape the area covered by the camera. Although this is not really an issue if you want to learn from state features, it can be a serious issue if you want to learn from pixels. Is this expected?

Somehow gym circumvents this issue by defining a track camera inside the body. But what I see in the dm control xmls is consistent with the technical document, where you highlight the use of camera 0th. And was wondering if you made other adjustments to the xml to ensure you keep track of the "agent".

Thanks,

new domain with STL mesh

how to create a new domain with STL mesh file?
when i tried to add mesh file to the domain xml file, Segmentation fault (core dumped) will come out.
while removing the asset it is normal.

Support Mujoco 2.0 ?

The recent upgrade of dm_control is really cool especially allowing easier manipulation with Python bindings. Some days ago, Mujoco 2.0 was released and seems like there are quite some changes. Curious to know if there is a roadmap to adapt to Mujoco 2.0 ?

Roll out time

After using Open AI gym environments, I notice that wall clock time of a typical roll out is higher in this suite. Does it have to do something with rendering (though I'm not rendering the environment). This makes training time longer.

Is there anything we should do to avoid rendering in the background and make it faster? Or env._sub_steps = 1 ?

Your inputs are highly appreciated.

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.