denisyarats / dmc2gym Goto Github PK
View Code? Open in Web Editor NEWOpenAI Gym wrapper for the DeepMind Control Suite
License: MIT License
OpenAI Gym wrapper for the DeepMind Control Suite
License: MIT License
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')
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'
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)
/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
how can I visualize the game?
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?
Hi @denisyarats, thank you for this amazing project. Any plans of publishing this to pypi yet?
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
Since the original OpenAI gym is no longer maintained, do you have plans to move or upgrade to gymnasium? Or would it be better for that to be a different project due to the breaking API changes in gymnasium?
The new API is nicely improved especially for the continuous control tasks of DMC with the addition of the termination and truncation.
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)
Hey Denis, thanks for this wrapper and congrats on your SAC_AE paper!
people have been running into a dm-control error when calling from dm_control import mujoco
from within dmc2gym
.
You can see the error message here: google-deepmind/dm_control#123 (comment)
Will post here if I find a solution.
Is it possible to use dmc2gym wrappers for the robosuite environments listed here? Or any other way to adapt dmc2gym for these environments? Thank you.
https://robosuite.ai/docs/source/robosuite.environments.manipulation.html
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
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.