Train and deploy your own humanoid robot controller in 700 lines of Python
ksim_video_0514.mp4
You can use this repository as a GitHub template or as a Google Colab.
You can quickly try out the humanoid benchmark by running the training notebook in Google Colab.
- Read through the current leaderboard submissions and through the ksim examples
- Create a new repository from this template by clicking here
- Make sure you have installed
git-lfs
:
sudo apt install git-lfs # Ubuntu
brew install git-lfs # MacOS
- Clone the new repository you create from this template:
git clone [email protected]:<YOUR USERNAME>/ksim-gym.git
cd ksim-gym
- Create a new Python environment (we require Python 3.11 or later)
- Install the package with its dependencies:
pip install -r requirements.txt
pip install 'jax[cuda12]' # If using GPU machine, install Jax CUDA libraries
- Train a policy:
python -m train
- Convert the checkpoint to a
kinfer
model:
python -m convert /path/to/ckpt.bin /path/to/model.kinfer
- Visualize the converted model:
kinfer-sim assets/model.kinfer kbot --save-video assets/video.mp4
- Commit the K-Infer model and the recorded video to this repository
- Push your code and model to your repository, and make sure the repository is public
- Write a message with a link to your repository on our Discord in the "【🧠】submissions" channel
- Wait for one of us to run it on the real robot - this should take about a day, but if we are dragging our feet, please message us on Discord
- Voila! Your name will now appear on our leaderboard
If you encounter issues, please consult the ksim documentation or reach out to us on Discord.
To see all the available command line arguments, use the command:
python -m train --help
To visualize running your model without using kos-sim
, use the command:
python -m train run_mode=view
This repository contains a pre-trained checkpoint of a model which has been learned to be robust to pushes, which is useful for both jump-starting model training and understanding the codebase. To initialize training from this checkpoint, use the command:
python -m train load_from_ckpt_path=assets/ckpt.bin
You can visualize the pre-trained model by combining these two commands:
python -m train load_from_ckpt_path=assets/ckpt.bin run_mode=view
If you want to use the Jupyter notebook and don't want to commit your training logs, we suggest using pre-commit to clean the notebook before committing:
pip install pre-commit
pre-commit install