Instructions to use lcccluck/mujoco-lerobot-train with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LeRobot
How to use lcccluck/mujoco-lerobot-train with LeRobot:
- Notebooks
- Google Colab
- Kaggle
| library_name: lerobot | |
| tags: | |
| - mujoco | |
| - lerobot | |
| - robotics | |
| - imitation-learning | |
| - act | |
| # mujoco_lerobot_train | |
|  | |
|  | |
| Minimal MuJoCo + LeRobot pipeline for: | |
| 1. collecting a standard LeRobot dataset | |
| 2. visualizing the dataset with `lerobot-dataset-viz` | |
| 3. training an ACT policy with `lerobot-train` | |
| 4. running closed-loop MuJoCo evaluation with the trained policy | |
| This directory is intentionally small. All parameters are read from one file: | |
| - `config.json` | |
| 这是一个最小化的 MuJoCo + LeRobot 工程,包含 4 步: | |
| 1. 用 MuJoCo 采集标准 LeRobot 数据集 | |
| 2. 用 `lerobot-dataset-viz` 可视化数据 | |
| 3. 用 `lerobot-train` 训练 ACT 策略 | |
| 4. 在 MuJoCo 中闭环评估训练好的策略 | |
| 整个目录尽量保持小而清晰,所有参数都只从一个文件读取: | |
| - `config.json` | |
| ## Dependencies | |
| - `mujoco` | |
| - `lerobot` | |
| See: | |
| - `requirements.txt` | |
| ## 依赖 | |
| - `mujoco` | |
| - `lerobot` | |
| 依赖文件见: | |
| - `requirements.txt` | |
| ## Files | |
| - `collect_dataset.py`: collect a MuJoCo pick-place dataset in LeRobot format | |
| - `viz_dataset.py`: open `lerobot-dataset-viz` for the configured dataset | |
| - `train_policy.py`: Python entry that reads config and launches training | |
| - `eval_policy.py`: closed-loop MuJoCo evaluation using the trained policy | |
| - `common.py`: shared minimal implementation | |
| - `config.json`: all parameters | |
| ## 文件说明 | |
| - `collect_dataset.py`:采集 MuJoCo 抓取放置数据,并写成 LeRobot 标准格式 | |
| - `viz_dataset.py`:调用 `lerobot-dataset-viz` 可视化当前数据集 | |
| - `train_policy.py`:读取配置后启动训练 | |
| - `eval_policy.py`:在 MuJoCo 中闭环评估训练好的策略 | |
| - `common.py`:公共最小实现 | |
| - `config.json`:全部参数 | |
| ## Run | |
| Activate your environment first: | |
| ```bash | |
| conda activate lerobot | |
| cd mujoco_lerobot_train | |
| ``` | |
| ## 运行 | |
| 先激活环境并进入目录: | |
| ```bash | |
| conda activate lerobot | |
| cd mujoco_lerobot_train | |
| ``` | |
| Collect dataset: | |
| ```bash | |
| python collect_dataset.py | |
| ``` | |
| Visualize dataset: | |
| ```bash | |
| python viz_dataset.py | |
| ``` | |
| Train with the Python entry: | |
| ```bash | |
| python train_policy.py | |
| ``` | |
| Closed-loop MuJoCo evaluation: | |
| ```bash | |
| python eval_policy.py | |
| ``` | |
| 闭环 MuJoCo 评估: | |
| ```bash | |
| python eval_policy.py | |
| ``` | |
| ## Config | |
| `config.json` controls: | |
| - dataset repo id and local root | |
| - image size and fps | |
| - number of episodes | |
| - ACT training hyperparameters | |
| - evaluation episodes and playback speed | |
| ## 配置 | |
| `config.json` 统一控制: | |
| - 数据集 repo id 和本地路径 | |
| - 图像分辨率和 fps | |
| - episode 数量 | |
| - ACT 训练参数 | |
| - 评估轮数和播放速度 | |
| ## Upload To Hugging Face | |
| Login first: | |
| ```bash | |
| huggingface-cli login | |
| ``` | |
| ## 上传到 Hugging Face | |
| 先登录: | |
| ```bash | |
| huggingface-cli login | |
| ``` | |
| Then upload this folder: | |
| ```bash | |
| bash ./upload_to_hf.sh <user_or_org>/<repo_name> | |
| ``` | |
| Private repo: | |
| ```bash | |
| HF_PRIVATE=1 bash ./upload_to_hf.sh <user_or_org>/<repo_name> | |
| ``` | |
| Dataset repo instead of model repo: | |
| ```bash | |
| HF_REPO_TYPE=dataset bash ./upload_to_hf.sh <user_or_org>/<repo_name> | |
| ``` | |
| Ignored during upload: | |
| - `outputs/` | |
| - `__pycache__/` | |
| - `*.pyc` | |
| 上传时会自动忽略: | |
| - `outputs/` | |
| - `__pycache__/` | |
| - `*.pyc` | |