Skip to content

Commit

Permalink
Update tutorial Colab to use dm_control 1.0.0.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 434618066
Change-Id: Ie59c2faa91b84cee091325a8355d7f56a72b8f42
  • Loading branch information
saran-t authored and copybara-github committed Mar 15, 2022
1 parent 668ba5a commit f707739
Showing 1 changed file with 3 additions and 45 deletions.
48 changes: 3 additions & 45 deletions tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -75,36 +75,12 @@
" 'Make sure you are using a GPU Colab runtime. '\n",
" 'Go to the Runtime menu and select Choose runtime type.')\n",
"\n",
"mujoco_dir = \"$HOME/.mujoco\"\n",
"\n",
"print('Installing OpenGL dependencies...')\n",
"!apt-get update -qq\n",
"!apt-get install -qq -y --no-install-recommends libglew2.0 \u003e /dev/null\n",
"\n",
"print('Downloading MuJoCo...')\n",
"BASE_URL = 'https://github.com/deepmind/mujoco/releases/download'\n",
"MUJOCO_VERSION = '2.1.1'\n",
"MUJOCO_ARCHIVE = (\n",
" f'mujoco-{MUJOCO_VERSION}-{distutils.util.get_platform()}.tar.gz')\n",
"!wget -q \"{BASE_URL}/{MUJOCO_VERSION}/{MUJOCO_ARCHIVE}\"\n",
"!wget -q \"{BASE_URL}/{MUJOCO_VERSION}/{MUJOCO_ARCHIVE}.sha256\"\n",
"check_result = !shasum -c \"{MUJOCO_ARCHIVE}.sha256\"\n",
"if _exit_code:\n",
" raise RuntimeError(\n",
" 'Downloaded MuJoCo archive is corrupted (checksum mismatch)')\n",
"\n",
"print('Unpacking MuJoCo...')\n",
"MUJOCO_DIR = '$HOME/.mujoco'\n",
"!mkdir -p \"{MUJOCO_DIR}\"\n",
"!tar -zxf {MUJOCO_ARCHIVE} -C \"{MUJOCO_DIR}\"\n",
"print('Installing dm_control...')\n",
"!pip install -q dm_control\u003e=1.0.0\n",
"\n",
"# Configure dm_control to use the EGL rendering backend (requires GPU)\n",
"%env MUJOCO_GL=egl\n",
"\n",
"print('Installing dm_control...')\n",
"# Version 0.0.416848645 is the first one to support MuJoCo 2.1.1.\n",
"!pip install -q dm_control\u003e=0.0.416848645\n",
"\n",
"print('Checking that the dm_control installation succeeded...')\n",
"try:\n",
" from dm_control import suite\n",
Expand All @@ -117,7 +93,7 @@
" 'If using a hosted Colab runtime, make sure you enable GPU acceleration '\n",
" 'by going to the Runtime menu and selecting \"Choose runtime type\".')\n",
"else:\n",
" del suite, env, pixels\n",
" del pixels, suite\n",
"\n",
"!echo Installed dm_control $(pip show dm_control | grep -Po \"(?\u003c=Version: ).+\")"
]
Expand Down Expand Up @@ -1841,24 +1817,6 @@
},
"name": "dm_control",
"private_outputs": true,
"provenance": [
{
"file_id": "1EBFHfEqrhxufldesVECPZfJF9HsKxAd2",
"timestamp": 1588282893099
},
{
"file_id": "0B8iLF4FF6KlDd0I3X2xTSHpQVEk",
"timestamp": 1573234197672
},
{
"file_id": "0B7GWNc3xBQH5ZjlPRzZGelNTcjg",
"timestamp": 1483004131812
},
{
"file_id": "0B7GWNc3xBQH5bHBRVkhOa1g3a28",
"timestamp": 1482848217314
}
],
"toc_visible": true
},
"kernelspec": {
Expand Down

0 comments on commit f707739

Please sign in to comment.