许可证:mit
基础模型:
- google/paligemma2-3b-pt-224
标签:
- VLA
- 基础视觉语言动作模型
- 通用机器人策略
- 机器人技术
语言:
- en
管道标签:image-text-to-text
库名称:transformers
SpatialVLA
SpatialVLA 是一个基于110万真实机器人操作片段训练的空间增强视觉语言动作模型。代码完全基于HuggingFace,简洁高效。
所有SpatialVLA检查点及训练代码库均以MIT许可证发布。
完整细节请阅读论文并访问项目主页。
模型详情
模型描述
使用场景
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模型无法零样本泛化到未见过的机器人构型或预训练数据未涵盖的设置。此类情况下,建议收集目标设置下的演示数据集并对SpatialVLA进行微调。
实践指南
如需微调或预训练模型,需先克隆官方仓库:
git clone https://github.com/SpatialVLA/SpatialVLA.git
随后安装依赖包并从Hugging Face模型中心下载模型。SpatialVLA的VLM主干为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
评估结果
(此处保留原始表格结构,仅翻译表头与内容)
(此处保留原始表格结构,仅翻译表头与内容)
(此处保留原始表格结构,仅翻译表头与内容)
引用
BibTeX:
@misc{qu2025spatialvlaexploringspatialrepresentations,
title={SpatialVLA: 视觉-语言-动作模型的空间表征探索},
author={瞿德林 and 宋浩明 and 陈启智 and 姚远祺 and 叶昕怡 and 丁岩 and 王志刚 and 顾佳元 and 赵斌 and 王栋 and 李学龙},
year={2025},
eprint={2501.15830},
archivePrefix={arXiv},
primaryClass={cs.RO},
url={https://arxiv.org/abs/2501.15830},
}