许可证: mit
语言:
- 英文
基础模型:
- IPEC-COMMUNITY/spatialvla-4b-224-pt
任务标签: 图像文本到文本
库名称: transformers
标签:
- 视觉语言动作模型
- 基础视觉语言动作模型
- 通用机器人策略
- 机器人学
基于fractal和bridge微调的SpatialVLA模型
该模型通过在fractal数据集上微调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="fractal20220817_data/0.1.0")
print(actions)
非适用场景
SpatialVLA模型无法零样本泛化到预训练数据未涵盖的新机器人构型或设置。对于此类情况,建议在目标设置上收集演示数据集并对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使用来自OXE和RH20T数据集的110万条真实机器人演示数据,在64块A100 GPU集群上以2048的批次大小预训练约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={瞿德林 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},
}