GH200(ARM64 aarch64)+ X-VLA 全量微调 LeHome Challenge 数据集。
- 远程服务器:NVIDIA GH200 / H100(ARM64 aarch64 架构)
- 本地机器:任意系统(用于本地 IsaacSim 评估)
- 代码托管:GitHub
- 模型权重托管:HuggingFace Hub
ssh ubuntu@<服务器IP>
# 如果有密钥文件:
ssh -i ~/.ssh/your_key.pem ubuntu@<服务器IP>wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-aarch64.sh
bash Miniforge3-Linux-aarch64.sh -b -p ~/miniforge3
source ~/miniforge3/etc/profile.d/conda.sh
echo 'source ~/miniforge3/etc/profile.d/conda.sh' >> ~/.bashrcconda create -n xvla_train python=3.11 -y
conda activate xvla_train# CUDA 12.6 wheel,兼容 CUDA 12.6/12.8 驱动
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu126验证:
python -c "import torch; print('CUDA:', torch.cuda.is_available(), torch.version.cuda, torch.cuda.get_device_name(0))"
# 预期输出:CUDA: True 12.6 NVIDIA GH200 480GB源码安装的好处:直接修改源文件即可生效,无需重新安装。
# 克隆 lerobot 源码
git clone https://github.com/huggingface/lerobot.git ~/lerobot
cd ~/lerobot
git checkout v0.4.3 # 锁定已验证版本
pip install -e ".[xvla]" # 可编辑安装
cd ~
# 其他依赖
pip install "transformers>=4.47.0,<5.0.0"
pip install draccus huggingface_hub
transformers版本必须锁定:低于 4.47 不支持 Florence2LanguageConfig,高于 5.0 不兼容 huggingface-hub 1.x。
验证:
python -c "import lerobot; print('lerobot OK')"
python -c "from transformers import AutoModel; print('transformers OK')"默认的 so101_bimanual 模式在训练时会把夹爪维度清零,导致模型永远无法学会闭合夹爪。
需要打上以下补丁:
# 找到 action_hub.py 的实际路径
ACTION_HUB=$(python -c "import lerobot.policies.xvla.action_hub as m; import inspect; print(inspect.getfile(m))")
echo $ACTION_HUB # 应该在 ~/lerobot/ 目录下
# 应用补丁
python -c "
path = '$ACTION_HUB'
with open(path) as f:
lines = f.readlines()
out = []
for i, line in enumerate(lines):
if 'gripper_idx] = 0.0' in line:
continue
if 'if action_m is not None:' in line and i+1 < len(lines) and 'gripper_idx] = 0.0' in lines[i+1]:
continue
if 'gripper_idx] = torch.sigmoid' in line:
continue
if 'if action.size(-1) > max(self.gripper_idx)' in line and i+1 < len(lines) and 'torch.sigmoid' in lines[i+1]:
continue
out.append(line)
with open(path, 'w') as f:
f.writelines(out)
print('夹爪修复完成:', path)
"验证补丁已生效:
grep -n "gripper_idx] = 0.0\|torch.sigmoid" $ACTION_HUB
# 预期:无输出(相关行已删除)# 首次部署:克隆仓库
git clone <你的GitHub仓库地址> ~/lehome-challenge
# 后续更新:拉取最新代码
cd ~/lehome-challenge
git pullcd ~/lehome-challenge
# 私有数据集需要先登录(在 huggingface.co/settings/tokens 生成 token)
huggingface-cli login
# 下载合并版数据集(无深度图,包含4种衣物类型)
huggingface-cli download lehome/dataset_challenge_merged \
--repo-type dataset \
--local-dir Datasets/example验证:
ls Datasets/example/
# 预期看到:four_types_merged pant_long_merged pant_short_merged top_long_merged top_short_merged训练不需要下载 Assets,Assets 只用于本地 IsaacSim 仿真评估。
cd ~/lehome-challenge
conda activate xvla_train
# 创建 tmux 会话,防止 SSH 断线后训练停止
tmux new -s xvla
# 启动训练(首次运行会自动从 HuggingFace 下载 xvla-base 约 3.5GB)
lerobot-train --config_path=configs/train_xvla.yaml- 断开 SSH 但保持训练继续:
Ctrl+B然后按D(detach) - 重新连回查看日志:
tmux attach -t xvla
另开一个 SSH 窗口:
# 查看 GPU 使用情况
watch -n 5 nvidia-smi
# 查看训练日志
tail -f ~/lehome-challenge/outputs/train/xvla_finetune_top_long_h100_v2/train.log预期 loss 曲线:从约 0.7 开始,100K steps 后降至 0.03–0.05。
cd ~/lehome-challenge
# 登录 HuggingFace(只需做一次)
huggingface-cli login
# 上传训练好的模型权重
huggingface-cli upload <你的HF用户名>/<模型仓库名> \
outputs/train/xvla_finetune_top_long_h100_v2/checkpoints/last/pretrained_model \
. \
--repo-type model先从 HuggingFace 下载 checkpoint:
cd /media/zihan-gao/lehome-challenge
huggingface-cli download <你的HF用户名>/<模型仓库名> \
--repo-type model \
--local-dir outputs/train/xvla_finetune_top_long_h100_v2/checkpoints/last/pretrained_model然后启动评估:
conda activate leisaac_dev
python -m scripts.eval \
--policy_type lerobot \
--policy_path outputs/train/xvla_finetune_top_long_h100_v2/checkpoints/last/pretrained_model \
--garment_type top_long \
--dataset_root Datasets/example/top_long_merged \
--num_episodes 5 \
--enable_cameras \
--task_description "fold the garment on the table" \
--headless# 从上次保存的 checkpoint 继续训练(每 10000 步自动保存一次)
lerobot-train --config_path=configs/train_xvla.yaml --resume=true| 命令 | 用途 |
|---|---|
tmux new -s xvla |
新建持久会话 |
tmux attach -t xvla |
断线后重新连接 |
Ctrl+B D |
断开会话(训练继续跑) |
watch -n 5 nvidia-smi |
监控 GPU |
lerobot-train --config_path=configs/train_xvla.yaml |
启动训练 |
lerobot-train ... --resume=true |
恢复训练 |
- ARM64 PyTorch 安装:必须用
pip install torch --index-url https://download.pytorch.org/whl/cu126,不能用conda install pytorch,也不能用cu124(aarch64 没有对应的 CUDA wheel)。 - eval 的 checkpoint 路径:必须指向
checkpoints/last/pretrained_model/,不是checkpoints/last/。 - bfloat16 转 numpy:eval 脚本需要在
.numpy()前加.float(),已在scripts/eval_policy/lerobot_policy.py第 117 行修复。 - IsaacSim 仿真:只能在本地运行,远程服务器不需要也无法运行。