Requirements
Our training code is based on mjlab, which uses MuJoCo Warp, a GPU accelerated backend optimized for NVIDIA GPUs. Locomotion training, especially with on policy algorithms such as PPO, requires many parallel environments to collect data efficiently. Therefore, a GPU with more than 24 GB of VRAM is preferred for large scale parallel training runs.
Quick start:
First, clone and install asimov training code in mjlab:
git clone https://github.com/asimovinc/mjlab
Then launch the Asimov locomotion task:
uv run train Mjlab-Velocity-Flat-Asimov-1 --env.scene.num-envs 4096
This will install all the dependencies automatically.Here, 4096 is the number of parallel simulation environments. More parallel environments can collect training data faster, but require more GPU VRAM. Start with 4096, then increase it gradually, for example to 8192 or 16384, if your GPU has sufficient memory and the training remains stable.
mjlab also supports training across multiple GPUs using --gpu-ids
uv run train Mjlab-Velocity-Flat-Asimov-1 \
--gpu-ids "[0, 1]" \
--env.scene.num-envs 4096
Visualize Training Progress Live with W&B
Weights & Biases logs training metrics such as reward, episode length, losses, and checkpoints. This makes it easier to monitor training progress, compare runs, and resume or evaluate saved policies. wandb is listed as a project dependency in pyproject.toml, so uv will install it automatically when you run uv sync, or when you launch training with uv run.
- Create a W&B account and open User Settings to create a personal API key
- Log in on the training machine:
wandb login
Paste the API key when prompted.
- Launch training with W&B enabled:
uv run train Mjlab-Velocity-Flat-Asimov-1 \
--env.scene.num-envs 4096 \
--logger wandb
- Visualize & evaluate a checkpoint
uv run play Mjlab-Velocity-Flat-Asimov-1 \
--checkpoint_file path/to/checkpoint.pt \
--viewer native
--viewer nativeopens MuJoCo’s local desktop viewer.--viewer viseropens a browser based viewer. It is useful when running on a remote machine or when you want the extra browser controls and plots.
Export a trained .pt checkpoint to an ONNX policy file :
Once sim training run is done, you need to export the policy to onnx format for real deployment:
uv run python scripts/Mjlab/export_onnx.py \
path/to/checkpoint.pt \
path/to/output_policy.onnx
Interactive humanoid policy viewer:
Besides the native MuJoCo and Viser viewers, you can also use the browser based MuJoCo WASM policy viewer for more interactive testing. It allows you to adjust velocity commands such as vx, vy, and yaw rate, apply external pushes to the robot, and modify domain randomization settings to evaluate policy robustness.
cd humanoid-policy-viewer
npm install
npm run dev