许可协议:mit
语言:
- 英文
基础模型:
- IPEC-COMMUNITY/spatialvla-4b-224-pt
任务类型:图像文本到文本
库名称:transformers
标签:
- VLA
- 基础视觉语言动作模型
- 通用机器人策略
- 机器人技术
基于fractal和bridge微调的SpatialVLA模型
该模型通过在bridge数据集上对SpatialVLA模型进行微调,专为Simpler-env基准测试打造。
模型详情
模型描述
用途
SpatialVLA完全基于HuggingFace Transformers🤗,部署极为简便。若环境支持transformers >= 4.47.0
,可直接使用以下代码加载模型并进行推理(需8.5GB GPU显存)。
直接使用
import torch
from PIL import Image
from transformers import AutoModel, AutoProcessor
model_name_or_path="IPEC-COMMUNITY/spatialvla-4b-224-pt"
processor = AutoProcessor.from_pretrained(model_name_or_path, trust_remote_code=True)
model = AutoModel.from_pretrained(model_name_or_path, trust_remote_code=True, torch_dtype=torch.bfloat16).eval().cuda()
image = Image.open("example.png").convert("RGB")
prompt = "机器人应采取什么动作拿起杯子?"
inputs = processor(images=[image], text=prompt, return_tensors="pt")
generation_outputs = model.predict_action(inputs)
actions = processor.decode_actions(generation_outputs, unnorm_key="bridge_orig/1.0.0")
print(actions)
非适用场景
SpatialVLA模型无法零样本泛化到预训练数据未涵盖的新机器人构型或设置。此类情况下,建议在目标设置上收集演示数据并对模型进行微调。
实践指南
如需微调或预训练模型,需先克隆官方仓库:
git clone https://github.com/SpatialVLA/SpatialVLA.git
随后安装依赖包并从Hugging Face模型中心下载模型。SpatialVLA的视觉语言模型骨干为PaLiGemma2,要求transformers >= 4.47.0,因此需创建Python >= 3.10的环境:
conda create -n spatialvla python=3.10
conda activate spatialvla
安装requirements.txt
中的依赖包。注意我们使用了定制版dlimp
以确保可复现性,若遇问题请手动安装dlimp_custom。
pip install -r requirements.txt
从头训练
SpatialVLA在64块A100 GPU集群上,使用2048的批量大小,通过OXE和RH20T数据集的110万条真实机器人演示数据进行了约10天的预训练。可通过以下命令从头开始预训练:
bash scripts/spatialvla_4b_pretrain/torchrun_pretrain.sh
bash scripts/spatialvla_4b_pretrain/slurm_pretrain.sh
微调
多数微调实验使用4或8块A100 GPU通过LoRA完成。小规模真实场景数据集推荐使用LoRA微调:
bash scripts/spatialvla_4b_finetune/finetune_full.sh
bash scripts/spatialvla_4b_finetune/finetune_lora.sh
性能评估
- Google Robot任务在SimplerEnv上的表现
(表格内容保持原格式,仅翻译表头)
模型 |
视觉匹配 |
变体聚合 |
拿取可乐罐 |
靠近物体 |
开/关抽屉 |
平均 |
拿取可乐罐 |
靠近物体 |
开/关抽屉 |
平均 |
- WidowX Robot任务在SimplerEnv上的表现
(表格内容保持原格式,仅翻译表头)
模型 |
将勺子放毛巾上 |
将胡萝卜放盘子上 |
绿块叠黄块上 |
将茄子放黄篮中 |
总平均 |
抓取勺子 |
成功率 |
抓取胡萝卜 |
成功率 |
抓取绿块 |
成功率 |
抓取茄子 |
成功率 |
引用
BibTeX格式:
@misc{qu2025spatialvlaexploringspatialrepresentations,
title={SpatialVLA: 探索视觉-语言-动作模型的空间表征},
author={Delin Qu and Haoming Song and Qizhi Chen and Yuanqi Yao and Xinyi Ye and Yan Ding and Zhigang Wang and JiaYuan Gu and Bin Zhao and Dong Wang and Xuelong Li},
year={2025},
eprint={2501.15830},
archivePrefix={arXiv},
primaryClass={cs.RO},
url={https://arxiv.org/abs/2501.15830},
}