From 7992fa193ea17187d0c1ab185384512df1251cf5 Mon Sep 17 00:00:00 2001 From: Nicklas Hansen Date: Tue, 13 May 2025 14:51:16 -0700 Subject: [PATCH] update readme + dockerfile --- README.md | 15 +++++++-------- docker/Dockerfile | 36 +++++------------------------------- 2 files changed, 12 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 9a3fd3f..ddf858a 100755 --- a/README.md +++ b/README.md @@ -36,19 +36,18 @@ You will need a machine with a GPU and at least 12 GB of RAM for single-task onl We provide a `Dockerfile` for easy installation. You can build the docker image by running ``` -cd docker && docker build . -t /tdmpc2:1.0.0 +cd docker && docker build . -t /tdmpc2:1.0.1 ``` -This docker image contains all dependencies needed for running DMControl, Meta-World, and ManiSkill2 experiments. +This docker image contains all dependencies needed for running DMControl. We also provide a pre-built docker image [here](https://hub.docker.com/repository/docker/nicklashansen/tdmpc2/tags/1.0.1/sha256-b07d4e04d4b28ffd9a63ac18ec1541950e874bb51d276c7d09b36135f170dd93). -If you prefer to install dependencies manually, start by installing dependencies via `conda` by running the following command: +If you prefer to use `conda` rather than docker, start by running the following command: ``` conda env create -f docker/environment.yaml -pip install gym==0.21.0 ``` -The `environment.yaml` file installs dependencies required for training on DMControl tasks. Other domains can be installed by following the instructions in `environment.yaml`. +The `docker/environment.yaml` file installs dependencies required for training on DMControl tasks. Other domains can be installed by following the instructions in `docker/environment.yaml`. If you want to run ManiSkill2, you will additionally need to download and link the necessary assets by running @@ -62,13 +61,13 @@ which downloads assets to `./data`. You may move these assets to any location. T export MS2_ASSET_DIR=// ``` -and restart your terminal. Meta-World additionally requires MuJoCo 2.1.0. We host the unrestricted MuJoCo 2.1.0 license (courtesy of Google DeepMind) at [https://www.tdmpc2.com/files/mjkey.txt](https://www.tdmpc2.com/files/mjkey.txt). You can download the license by running +and restart your terminal. Note that Meta-World requires MuJoCo 2.1.0 and `gym==0.21.0` which is becoming increasingly difficult to install. We host the unrestricted MuJoCo 2.1.0 license (courtesy of Google DeepMind) at [https://www.tdmpc2.com/files/mjkey.txt](https://www.tdmpc2.com/files/mjkey.txt). You can download the license by running ``` wget https://www.tdmpc2.com/files/mjkey.txt -O ~/.mujoco/mjkey.txt ``` -See `docker/Dockerfile` for installation instructions if you do not already have MuJoCo 2.1.0 installed. MyoSuite requires `gym==0.13.0` which is incompatible with Meta-World and ManiSkill2. Install separately with `pip install myosuite` if desired. Depending on your existing system packages, you may need to install other dependencies. See `docker/Dockerfile` for a list of recommended system packages. +Depending on your existing system packages, you may need to install other dependencies. See `docker/Dockerfile` for a list of recommended system packages. ---- @@ -87,7 +86,7 @@ This codebase provides support for all **104** continuous control tasks from **D | myosuite | myo-key-turn | myosuite | myo-key-turn-hard -which can be run by specifying the `task` argument for `evaluation.py`. Multi-task training and evaluation is specified by setting `task=mt80` or `task=mt30` for the 80-task and 30-task sets, respectively. We also provide basic support for other MuJoCo/Box2d Gymnasium tasks; refer to the `envs` directory for a list of tasks. It should be relatively straightforward to add support for custom tasks by following the examples in `envs`. +which can be run by specifying the `task` argument for `evaluation.py`. Multi-task training and evaluation is specified by setting `task=mt80` or `task=mt30` for the 80-task and 30-task sets, respectively. While you generally do not need to access the underlying task IDs or embeddings during training or evaluation of our multi-task models, the mapping from task name to task embedding used in our work can be found [here](https://github.com/nicklashansen/tdmpc2/blob/7ec6bc83a82a5188ca3faddc59aea83f430ab570/tdmpc2/common/__init__.py#L26). As of April 2025, our codebase also provides basic support for other MuJoCo/Box2d Gymnasium tasks; refer to the `envs` directory for a list of tasks. It should be relatively straightforward to add support for custom tasks by following the examples in `envs`. **Note:** we also provide support for image observations in the DMControl tasks. Use argument `obs=rgb` if you wish to train visual policies. diff --git a/docker/Dockerfile b/docker/Dockerfile index 60fe07c..a045a71 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -4,14 +4,14 @@ # https://www.tdmpc2.com # # -------------------------------------- # # Build instructions: # -# docker build . -t /tdmpc2:1.0.0 # -# docker push /tdmpc2:1.0.0 # +# docker build . -t /tdmpc2:1.0.1 # +# docker push /tdmpc2:1.0.1 # # -------------------------------------- # # Run: # # docker run -i \ # # -v //tdmpc2:/tdmpc2 \ # # --gpus all \ # -# -t /tdmpc2:1.0.0 \ # +# -t /tdmpc2:1.0.1 \ # # /bin/bash # ########################################## @@ -42,34 +42,8 @@ RUN conda update conda && \ conda init SHELL ["/bin/bash", "-c"] RUN echo "cd /root" >> /root/.bashrc - -# mujoco 2.1.0 -ENV MUJOCO_GL egl -ENV LD_LIBRARY_PATH /root/.mujoco/mujoco210/bin:${LD_LIBRARY_PATH} -RUN mkdir -p /root/.mujoco && \ - wget https://www.tdmpc2.com/files/mjkey.txt && \ - wget https://github.com/deepmind/mujoco/releases/download/2.1.0/mujoco210-linux-x86_64.tar.gz && \ - tar -xzf mujoco210-linux-x86_64.tar.gz && \ - rm mujoco210-linux-x86_64.tar.gz && \ - mv mujoco210 /root/.mujoco/mujoco210 && \ - mv mjkey.txt /root/.mujoco/mjkey.txt && \ - find /root/.mujoco -uid 421709 -exec chown root:root {} \; && \ - python -c "import mujoco_py" - -# gym -RUN pip install gym==0.21.0 - -# metaworld -RUN pip install git+https://github.com/Farama-Foundation/Metaworld.git@04be337a12305e393c0caf0cbf5ec7755c7c8feb - -# maniskill2 -ENV MS2_ASSET_DIR /root/data -RUN pip install mani-skill2==0.4.1 && \ - cd /root && \ - python -m mani_skill2.utils.download_asset all -y - -# myosuite (conflicts with meta-world / mani-skill2) -# RUN pip install myosuite +# image does not include metaworld, maniskill, myosuite +# these can be installed separately; see environment.yaml for details # success! RUN echo "Successfully built TD-MPC2 Docker image!"