AI model
TD-MPC2
From github.com/nicklashansen/tdmpc2 (opens in a new tab)
- Humanoids and robot learning
- MIT (code)
- MIT (weights)
TD-MPC2 is an official research implementation of a scalable model-based reinforcement learning algorithm for continuous control, trained and evaluated on single or multiple tasks.
Facts
- Code last updated
- 21 Oct 2026Newest commit on main
- Maintenance
- Activea commit in the last 90 days
- Difficulty
- Advanced
- Hardware it needs, as the project states it
- A machine with a GPU and at least 12 GB of RAM for single-task online RL; 128 GB of RAM for multi-task offline RL on the 80-task dataset. A GPU with at least 8 GB of memory is recommended for single-task online RL and evaluating the multi-task models (up to 317M parameters); training the 317M parame
Checked on GitHub on 29 Nov 2026.
Licenses
- Code
- MIT (opens in a new tab)
Read by Robotheca from LICENSE (opens in a new tab) (MIT) at commit 332f19e (opens in a new tab), on 24 Oct 2026.
- Commercial use
- Yes
At a glance
- What it is
- Trains and evaluates single-task online RL and multi-task offline RL agents for continuous control.
- Covers 104 continuous control tasks across DMControl, Meta-World, ManiSkill2 and MyoSuite.
- Provides 300+ pretrained model checkpoints, including 12 multi-task models, plus 30-task and 80-task datasets.
- Supports both state and pixel (rgb) observations.
- Adds optional episodic RL support for tasks with terminations, disabled by default for reproducibility.
- Training and evaluation are run with evaluate.py and train.py, configured through config.yaml.
Robotheca's summary of the project's documents, not the creator's words.
- Robots on Robotheca
- No robot on Robotheca uses this model yet.
- Licence
- MIT (code); MIT (weights). Commercial use: Yes. Where it was read
- Load it
- In the creator's words: The project's website (opens in a new tab)
- Maintenance
- Active, last commit on 21 Oct 2026.
Use it
How to load it, in the creator's words: The project's website (opens in a new tab)
Robotheca doesn't review code. Read it before running it.
Files and versions
- Repository on GitHubgithub.com/nicklashansen/tdmpc2 (opens in a new tab)
- The version Robotheca read332f19e (opens in a new tab)
- Latest releaseNone published on GitHub
- Model card on Hugging Facehuggingface.co/nicklashansen/tdmpc2 (opens in a new tab)
Robotheca read the repository at two versions: the summary at e9f5932 and the facts and the README at 332f19e (read on 29 Nov 2026).
Robotheca never hosts the code or the weights: each link goes to the creator's own page.
The README and the model card
The creator's own README, copied as written: README.md by @nicklashansen, at commit 332f19e, under MIT (opens in a new tab). The original on GitHub (opens in a new tab).
Read the README here
TD-MPC2
Official implementation of
TD-MPC2: Scalable, Robust World Models for Continuous Control (opens in a new tab) by
Nicklas Hansen (opens in a new tab), Hao Su (opens in a new tab)*, Xiaolong Wang (opens in a new tab)* (UC San Diego)








[Website] (opens in a new tab) [Paper] (opens in a new tab) [Models] (opens in a new tab) [Dataset] (opens in a new tab)
Announcement (Apr 2025): support for episodic tasks!
We have added support for episodic RL (tasks with terminations) in the latest release. This functionality can be enabled with episodic=true but remains disabled by default to ensure reproducibility of results across releases.
Overview
TD-MPC2 is a scalable, robust model-based reinforcement learning algorithm. It compares favorably to existing model-free and model-based methods across 104 continuous control tasks spanning multiple domains, with a single set of hyperparameters (right). We further demonstrate the scalability of TD-MPC2 by training a single 317M parameter agent to perform 80 tasks across multiple domains, embodiments, and action spaces (left).

This repository contains code for training and evaluating both single-task online RL and multi-task offline RL TD-MPC2 agents. We additionally open-source 300+ model checkpoints (opens in a new tab) (including 12 multi-task models) across 4 task domains: DMControl (opens in a new tab), Meta-World (opens in a new tab), ManiSkill2 (opens in a new tab), and MyoSuite (opens in a new tab), as well as our 30-task and 80-task datasets (opens in a new tab) used to train the multi-task models. Our codebase supports both state and pixel observations. We hope that this repository will serve as a useful community resource for future research on model-based RL.
Getting started
You will need a machine with a GPU and at least 12 GB of RAM for single-task online RL with TD-MPC2, and 128 GB of RAM for multi-task offline RL on our provided 80-task dataset. A GPU with at least 8 GB of memory is recommended for single-task online RL and for evaluation of the provided multi-task models (up to 317M parameters). Training of the 317M parameter model requires a GPU with at least 24 GB of memory.
We provide a Dockerfile for easy installation. You can build the docker image by running
cd docker && docker build . -t <user>/tdmpc2:1.0.1
This docker image contains all dependencies needed for running DMControl. We also provide a pre-built docker image here (opens in a new tab).
If you prefer to use conda rather than docker, start by running the following command:
conda env create -f docker/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
python -m mani_skill2.utils.download_asset all
which downloads assets to ./data. You may move these assets to any location. Then, add the following line to your ~/.bashrc:
export MS2_ASSET_DIR=<path>/<to>/<data>
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 (opens in a new tab). You can download the license by running
wget https://www.tdmpc2.com/files/mjkey.txt -O ~/.mujoco/mjkey.txt
Depending on your existing system packages, you may need to install other dependencies. See docker/Dockerfile for a list of recommended system packages.
Supported tasks
This codebase provides support for all 104 continuous control tasks from DMControl, Meta-World, ManiSkill2, and MyoSuite used in our paper. Specifically, it supports 39 tasks from DMControl (including 11 custom tasks), 50 tasks from Meta-World, 5 tasks from ManiSkill2, and 10 tasks from MyoSuite, and covers all tasks used in the paper. See below table for expected name formatting for each task domain:
| domain | task |
|---|---|
| dmcontrol | dog-run |
| dmcontrol | cheetah-run-backwards |
| metaworld | mw-assembly |
| metaworld | mw-pick-place-wall |
| maniskill | pick-cube |
| maniskill | pick-ycb |
| 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. 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 (opens in a new tab). 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.
Example usage
We provide examples on how to evaluate our provided TD-MPC2 checkpoints, as well as how to train your own TD-MPC2 agents, below.
Evaluation
See below examples on how to evaluate downloaded single-task and multi-task checkpoints.
$ python evaluate.py task=mt80 model_size=48 checkpoint=/path/to/mt80-48M.pt
$ python evaluate.py task=mt30 model_size=317 checkpoint=/path/to/mt30-317M.pt
$ python evaluate.py task=dog-run checkpoint=/path/to/dog-1.pt save_video=true
All single-task checkpoints expect model_size=5. Multi-task checkpoints are available in multiple model sizes. Available arguments are model_size={1, 5, 19, 48, 317}. Note that single-task evaluation of multi-task checkpoints is currently not supported. See config.yaml for a full list of arguments.
Training
See below examples on how to train TD-MPC2 on a single task (online RL) and on multi-task datasets (offline RL). We recommend configuring Weights and Biases (opens in a new tab) (wandb) in config.yaml to track training progress.
$ python train.py task=mt80 model_size=48 batch_size=1024
$ python train.py task=mt30 model_size=317 batch_size=1024
$ python train.py task=dog-run steps=7000000
$ python train.py task=walker-walk obs=rgb
We recommend using default hyperparameters for single-task online RL, including the default model size of 5M parameters (model_size=5). Multi-task offline RL benefits from a larger model size, but larger models are also increasingly costly to train and evaluate. Available arguments are model_size={1, 5, 19, 48, 317}. See config.yaml for a full list of arguments.
Citation
If you find our work useful, please consider citing our paper as follows:
@inproceedings{hansen2024tdmpc2,
title={TD-MPC2: Scalable, Robust World Models for Continuous Control},
author={Nicklas Hansen and Hao Su and Xiaolong Wang},
booktitle={International Conference on Learning Representations (ICLR)},
year={2024}
}
as well as the original TD-MPC paper:
@inproceedings{hansen2022tdmpc,
title={Temporal Difference Learning for Model Predictive Control},
author={Nicklas Hansen and Xiaolong Wang and Hao Su},
booktitle={International Conference on Machine Learning (ICML)},
year={2022}
}
Contributing
You are very welcome to contribute to this project. Feel free to open an issue or pull request if you have any suggestions or bug reports, but please review our guidelines (opens in a new tab) first. Our goal is to build a codebase that can easily be extended to new environments and tasks, and we would love to hear about your experience!
License
This project is licensed under the MIT License - see the LICENSE file for details. Note that the repository relies on third-party code, which is subject to their respective licenses.
Robotheca lists AI models as a reference: nothing is hosted or run here, and every fact links to where it was read.