Skip to content

Commit 7359c4d

Browse files
yuvaltassacopybara-github
authored andcommitted
Update external dm_control installation in mujoco/tutorial.ipynb
PiperOrigin-RevId: 449189277 Change-Id: Id37f29667cc4455383ba7999b4519ed7b83f4fcb
1 parent c500319 commit 7359c4d

1 file changed

Lines changed: 6 additions & 29 deletions

File tree

dm_control/mujoco/tutorial.ipynb

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
"id": "MpkYHwCqk7W-"
77
},
88
"source": [
9-
"# **MuJoCo** tutorial\n",
10-
"### using `dm_control` Python bindings\n",
9+
"# **MuJoCo** tutorial with `dm_control` Python bindings\n",
1110
"\n",
1211
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/deepmind/dm_control/blob/main/dm_control/mujoco/tutorial.ipynb)\n",
1312
"\n",
@@ -77,35 +76,12 @@
7776
" 'Make sure you are using a GPU Colab runtime. '\n",
7877
" 'Go to the Runtime menu and select Choose runtime type.')\n",
7978
"\n",
80-
"mujoco_dir = \"$HOME/.mujoco\"\n",
81-
"\n",
82-
"print('Installing OpenGL dependencies...')\n",
83-
"!apt-get update -qq\n",
84-
"!apt-get install -qq -y --no-install-recommends libglew2.0 \u003e /dev/null\n",
85-
"\n",
86-
"print('Downloading MuJoCo...')\n",
87-
"MUJOCO_VERSION = 210\n",
88-
"MUJOCO_ARCHIVE = (\n",
89-
" f'mujoco{MUJOCO_VERSION}-{distutils.util.get_platform()}.tar.gz')\n",
90-
"!wget -q \"https://mujoco.org/download/{MUJOCO_ARCHIVE}\"\n",
91-
"!wget -q \"https://mujoco.org/download/{MUJOCO_ARCHIVE}.sha256\"\n",
92-
"check_result = !shasum -c \"{MUJOCO_ARCHIVE}.sha256\"\n",
93-
"if _exit_code:\n",
94-
" raise RuntimeError(\n",
95-
" 'Downloaded MuJoCo archive is corrupted (checksum mismatch)')\n",
96-
"\n",
97-
"print('Unpacking MuJoCo...')\n",
98-
"MUJOCO_DIR = '$HOME/.mujoco'\n",
99-
"!mkdir -p \"{MUJOCO_DIR}\"\n",
100-
"!tar -zxf {MUJOCO_ARCHIVE} -C \"{MUJOCO_DIR}\"\n",
79+
"print('Installing dm_control...')\n",
80+
"!pip install -q dm_control\u003e=1.0.2\n",
10181
"\n",
10282
"# Configure dm_control to use the EGL rendering backend (requires GPU)\n",
10383
"%env MUJOCO_GL=egl\n",
10484
"\n",
105-
"print('Installing dm_control...')\n",
106-
"# TODO(b/211110746): Upgrade to the latest version once PyPI package is out.\n",
107-
"!pip install -q dm_control==0.0.403778684\n",
108-
"\n",
10985
"print('Checking that the dm_control installation succeeded...')\n",
11086
"try:\n",
11187
" from dm_control import suite\n",
@@ -118,7 +94,8 @@
11894
" 'If using a hosted Colab runtime, make sure you enable GPU acceleration '\n",
11995
" 'by going to the Runtime menu and selecting \"Choose runtime type\".')\n",
12096
"else:\n",
121-
" del suite, env, pixels"
97+
" del suite, pixels\n",
98+
"print('dm_control installation succeeded.')"
12299
]
123100
},
124101
{
@@ -1308,7 +1285,7 @@
13081285
"physics.model.vis.scale.contactwidth = 0.1\n",
13091286
"physics.model.vis.scale.contactheight = 0.03\n",
13101287
"physics.model.vis.scale.forcewidth = 0.05\n",
1311-
"physics.model.vis.map_.force = 0.3\n",
1288+
"physics.model.vis.map.force = 0.3\n",
13121289
"\n",
13131290
"# random initial rotational velocity:\n",
13141291
"with physics.reset_context():\n",

0 commit comments

Comments
 (0)