统一视频动作模型 (RSS 2025) 的官方 PyTorch 实现
[Project page] [Paper] [Colab (PushT)]
Shuang Li, Yihuai Gao, Dorsa Sadigh, Shuran Song
Stanford University
We provide a colab notebook for UVA on PushT using the pretrained checkpoint.
Install the conda environment:
$ conda install mamba -c conda-forge$ mamba env create -f conda_environment.ymlDownload the pretrained checkpoints from the following links and put them in the checkpoints/ folder.
pip install gdown
gdown 1OduHcxfc2hqUYSccMQNf9g-vAt-q2UhF -O checkpoints/pusht.ckpt
gdown 1ZppZJyQdEdjhu8TIt4ddyaWy_mSdjoAZ -O checkpoints/pusht_multitask.ckpt
gdown 11c2VrmaRp48yw__5A5xpcu8EPzkexHSi -O checkpoints/libero10.ckptCUDA_VISIBLE_DEVICES=0 python eval_sim.py --checkpoint checkpoints/pusht.ckpt --output_dir checkpoints/pushtCUDA_VISIBLE_DEVICES=0 python eval_sim.py --checkpoint checkpoints/pusht_multitask.ckpt --output_dir checkpoints/pusht_multitaskCUDA_VISIBLE_DEVICES=0 python eval_sim.py --checkpoint checkpoints/libero10.ckpt --output_dir checkpoints/libero10We start from a pretrained VAE model and a pretrained image generation model MAR. Run the following command to download the pretrained models.
python unified_video_action/utils/download.pyWe found that two-stage training works better than training on both video and action tasks directly. In the first stage, the model is trained on video generation task, and in the second stage, it is fine-tuned on both video and action tasks.
To train the UVA model for the video generation task, we set predict_action=False and selected_training_mode=video_model. We did not incorporate additional video data during training. We believe that pretraining the model on large-scale web video datasets could substantially improve its generalization capabilities, and we plan to explore this approach in future work.
UVA's performance may currently be constrained by the model size. To evaluate it on larger or more complex real-world tasks, please consider using a larger UVA model.
Training video and action model takes longer time than training policy model only. We recommend using at least 4 GPUs for training. To train the UVA model on the PushT dataset, run the following command:
accelerate launch --num_processes=8 train.py \
--config-dir=. \
--config-name=uva_pusht.yaml \
model.policy.action_model_params.predict_action=False \
model.policy.selected_training_mode=video_model \
model.policy.optimizer.learning_rate=1e-4 \
logging.project=uva \
hydra.run.dir="checkpoints/uva_pusht_video_model"To train the UVA model on the joint video and action tasks, we set predict_action=True and remove selected_training_mode=video_model.
To train the UVA model on the UMI multi-task dataset, run the following command:
accelerate launch --num_processes=8 train.py \
--config-dir=. \
--config-name=uva_pusht.yaml \
model.policy.autoregressive_model_params.pretrained_model_path=checkpoints/uva_pusht_video_model/checkpoints/latest.ckpt \
model.policy.action_model_params.predict_action=True
model.policy.optimizer.learning_rate=1e-4 \
logging.project=uva \
hydra.run.dir="uva_pusht_video_act_model"Be careful when conducting real robot experiments. The robot moves quickly and can be dangerous.
Download the pretrained checkpoints from the following links and put them in the checkpoints/ folder.
This checkpoint is trained on 500 samples from each of the three datasets: Cup, Towel, and Mouse.
Please follow the instructions in arx5-sdk to setup the ARX X5 robot controller. Other models of robot arms could be used by modifying the arguments when running the controller.
To setup the UMI-related hardware (Camera, Gripper, etc.), please refer to the codebase of UMI-on-Legs and check out the 3d printing and assembly instructions.
We recommend first deploying the umi-arx codebase to test the hardware setup. For UVA deployment, please checkout the uva branch for some updates with more safety checks.
Instead of running the detached_policy_inference.py in the UMI codebase, please run sh scripts/eval/eval_real.sh to serve the UVA model. You can modify the parameters in the eval_real.sh for different checkpoints and tcp ports. The rest of the deployment process is the same as the original UMI codebase.
To train the video generation model on the UMI multi-task dataset, run the following command:
accelerate launch --num_processes=8 train.py \
--config-dir=. \
--config-name=uva_umi_multi.yaml \
model.policy.action_model_params.predict_action=False \
model.policy.selected_training_mode=video_model \
model.policy.different_history_freq=True \
model.policy.optimizer.learning_rate=1e-4 \
task.dataset.dataset_root_dir=${dataset_path} \
logging.project=uva \
hydra.run.dir="checkpoints/uva_umi_multitask_video"For all real-world experiments, we set different_history_freq=True to use distinct history frequencies during training. Since the control frequency on real robot may differ from the data frequency in the collected dataset, using different history frequencies helps the model perform better during testing.
To train the UVA model on the UMI multi-task dataset, run the following command:
…All datasets are publicly available except for PushT-M. We extend the PushT task by incorporating various target “T” positions and have collected a new dataset containing 247 demonstrations. Download the datasets and put them in the data folder.
data folder.AutoTokenizer.from_pretrained("openai/clip-vit-base-patch32"). Download both the original hdf5 file and the converted dataset. Then, extract their contents and place them in the data folder.ph/image_abs.hdf5. Place it in the data/tool_hang/ph/image_abs.hdf5 folder.process_dataset/download_dataset.py to download and process the datasets.We modified the UMI dataloader to support multiple UMI datasets. We also optimized the memory usage and data loading speed especially when running on a SLURM system for large scale training.
The pipeline of processing the dataset is as follows, see process_dataset/download_dataset.py for more details:
.zarr.zip format) from the corresponding urls. You can comment out the lines you don't need./dev/shm) and decompress it to a .zarr folder. The script is processing all the selected datasets in parallel, thus please make sure the server has enough available memory (at least 500GB). If not, you can run the process_dataset function (in download_dataset.py) inside a for loop.lz4 for faster compression and decompression speed. Then copy the .zarr.tar.lz4 files back to your data_dir.During training, you can run process_dataset/extract_umi_data.py to extract multiple datasets into your shared memory /dev/shm or a local disk in a SLURM system. When loading data batches, the dataloader unified_video_action/dataset/umi_multi_dataset.py will randomly choose a UMI dataset and fetch the data from the shared memory in a "lazy" manner, i.e. only copy the data into program memory when needed and release it afterwards. Therefore during training, there will not be duplicated data in memory even if you are training on multiple GPUs.
Note that we do not use mirrors in the deployment setup. Therefore, we mask out all the mirror regions in the dataset whose gripper has mirror. You can modify the mask_mirror option in umi_multi.yaml to specify individually for each dataset.
For multi-node training, please refer to scripts/training/train_uva_umi_multi_node.sh if you are using SLURM.
To add your own task, you need to implement a dataset, an environment runner, and a task configuration file. For guidance, please refer to the following examples from existing tasks:
unified_video_action/config/task/umi_multi.yamlunified_video_action/dataset/umi_multi_dataset.pyMake sure that shape_meta correspond to input and output shapes for your task. Make sure env_runner._target_ and dataset._target_ point to the new classes you have added. When training, add task= to train.py's arguments.
To add your own model, you need to implement a configuration file, a workspace, and a policy file. For guidance, please refer to the following examples from existing models:
暂无开放 Issues,或尚未同步最近议题。