
1. Lingbot-VA 环境安装 训练指南目录1 仓库获取2 构建 Docker 镜像2.1 Dockerfile 内容2.2 镜像构建说明3 宿主机提前下载 Flash-Attention whl4 启动容器5 容器内安装剩余依赖6 训练前准备6.1 数据集6.2 预训练模型权重6.3 配置文件修改6.3.1 va_demo_cfg.py模型权重路径6.3.2 va_demo_train_cfg.py数据集路径 wandb 开关7 启动训练8 训练成功日志示例1 仓库获取gitclone https://github.com/Robbyant/lingbot-va2 构建 Docker 镜像2.1 Dockerfile 内容以下 Dockerfile 包含Ubuntu 24.04 CUDA 12.8 cuDNN conda (fastwam py3.10) PyTorch 2.7.1 基础 Python 依赖。ARG TARGETPLATFORM ARG BASE_IMAGEnvidia/cuda:12.8.1-cudnn-devel-ubuntu24.04 FROM ${BASE_IMAGE} ARG TARGETPLATFORM # Set the DEBIAN_FRONTEND environment variable to avoid interactive prompts during apt operations. ENV DEBIAN_FRONTENDnoninteractive SHELL [/bin/bash, -lc] RUN apt-get update apt-get install -y --no-install-recommends \ build-essential \ ca-certificates \ curl \ ffmpeg \ git \ libaio-dev \ libavcodec-dev \ libavformat-dev \ libavutil-dev \ libnuma-dev \ libswscale-dev \ pkg-config \ wget \ rm -rf /var/lib/apt/lists/* ARG CONDA_DIR/opt/conda RUN if [[ ${TARGETPLATFORM:-linux/amd64} linux/arm64 ]]; then \ installer_urlhttps://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-aarch64.sh; \ else \ installer_urlhttps://repo.anaconda.com/miniconda/Miniconda3-py310_24.7.1-0-Linux-x86_64.sh; \ fi \ curl -fsSL ${installer_url} -o /tmp/conda.sh \ bash /tmp/conda.sh -b -p ${CONDA_DIR} \ rm -f /tmp/conda.sh \ ${CONDA_DIR}/bin/conda clean -afy ENV PATH/opt/conda/bin:$PATH RUN conda create -n fastwam python3.10 -y conda clean -afy ENV CONDA_DEFAULT_ENVfastwam ENV PATH/opt/conda/envs/fastwam/bin:/opt/conda/bin:$PATH RUN python -m pip install -U pip \ python -m pip install torch2.7.1cu128 torchvision0.22.1cu128 --extra-index-url https://download.pytorch.org/whl/cu128 RUN python -m pip install websockets einops diffusers0.36.0 transformers4.55.2 accelerate msgpack opencv-python matplotlib ftfy easydict2.2 镜像构建说明将上方 Dockerfile 保存为Dockerfile后再按 4 启动容器 中的docker build命令一起构建即可。Flash-Attention 不在 Dockerfile 中直接安装原因是其 wheel 包较大放在 第 3 步 单独下载然后在 第 5 步 进入容器后通过 volume 挂载安装。3 宿主机提前下载 Flash-Attention whl在网页中找到对应版本的.whl文件下载链接https://github.com/Dao-AILab/flash-attention/releases本次使用的 wheel 包CUDA 12 Torch 2.7 Python 3.10 x86_64flash_attn-2.8.1cu12torch2.7cxx11abiFALSE-cp310-cp310-linux_x86_64.whl下载后把 wheel 包放到宿主机当前目录下一节的docker run -v $(pwd):/workspace会把整个目录挂到容器内容器里即可直接安装。4 启动容器先构建镜像再启动容器host 网络、共享 64G /dev/shm、挂载工作目录和 HuggingFace 缓存dockerbuild-tlingbot.dockerrun--gpusall-it--rm\--networkhost\--shm-size64g\-v$(pwd):/workspace\-v$HOME/.cache/huggingface:/root/.cache/huggingface\lingbot5 容器内安装剩余依赖进入容器后执行以下命令安装 Flash-Attention、lerobot、scipy、wandb并将 datasets 降级到 4.0.0pipinstallflash_attn-2.8.1cu12torch2.7cxx11abiFALSE-cp310-cp310-linux_x86_64.whl pipinstalllerobot0.3.3 scipy wandb pip uninstall datasets pipinstalldatasets4.0.0datasets 必须是 4.0.0旧版 LeRobot 数据集 parquet 元数据里用了List类型新版 datasets 已改名为Sequence4.0.0 版本能同时兼容两者。6 训练前准备6.1 数据集DownloadExample Dataset下载后解压到容器内能访问到的路径例如/workspace/pick-n-place-sq-lerobot-v21见 6.3.2。6.2 预训练模型权重 HuggingFace 模型页robbyant/lingbot-va-base首次运行训练命令时会自动下载到/root/.cache/huggingface/...如果是离线机器提前在宿主机下载好docker run -v $HOME/.cache/huggingface:/root/.cache/huggingface就会直接挂载复用无需容器内再联网下载。6.3 配置文件修改6.3.1 va_demo_cfg.py模型权重路径文件路径lingbot-va/wan_va/configs/va_demo_cfg.py将预训练模型快照目录填到wan22_pretrained_model_name_or_pathva_demo_cfg.wan22_pretrained_model_name_or_path/root/.cache/huggingface/hub/models--robbyant--lingbot-va-base/snapshots/68b7bc1b35da6ddc67ea94c4ceb58d768fbb3f9c注意该路径下需要包含transformer/子目录diffusion_pytorch_model.safetensors等权重文件train.py中会再拼一层transformer。6.3.2 va_demo_train_cfg.py数据集路径 wandb 开关文件路径lingbot-va/wan_va/configs/va_demo_train_cfg.pyva_demo_train_cfg.dataset_path/workspace/pick-n-place-sq-lerobot-v21va_demo_train_cfg.enable_wandbFalse## 取消wandb记录dataset_path指向 6.1 数据集 解压后的根目录要求其下包含若干子数据集目录每个子目录内有meta/info.jsonenable_wandb False若没填真实的WANDB_API_KEY / WANDB_BASE_URL务必保持 False否则wandb.login()会因非法 URL 而报错7 启动训练在宿主机或容器内/workspace目录执行NGPU8CONFIG_NAMEdemo_trainbashscript/run_va_posttrain.sh参数含义NGPU8单节点 GPU 数传给torch.distributed.run --nproc_per_node8CONFIG_NAMEdemo_train脚本script/run_va_posttrain.sh通过--config-name demo_train传给wan_va.traintrain.py里用VA_CONFIGS[demo_train]取出 [configs/init.py](file:///home/zhouruiliang/work/zhou/pro_xing/vla_world_exp/lingbot-va/wan_va/configs/init.py) 中登记的va_demo_train_cfg配置对象其他常见 CONFIG_NAMElibero_train、robotwin_train。8 训练成功日志示例以下是训练成功跑起来时 rank 0 的标准输出参考8 GPUdemo_train2000 步NGPU8CONFIG_NAMEdemo_trainbashscript/run_va_posttrain.sh umask007 NGPU8MASTER_PORT29501PORT1106LOG_RANK0TORCHFT_LIGHTHOUSEhttp://localhost:29510 CONFIG_NAMEdemo_train overrides[0-ne0]exportWANDB_API_KEYyour keyWANDB_API_KEYyour keyexportWANDB_BASE_URLyour urlWANDB_BASE_URLyour urlexportWANDB_TEAM_NAMEyour team nameWANDB_TEAM_NAMEyour team nameexportWANDB_PROJECTyour projectWANDB_PROJECTyour projectnum_gpu8master_port29501log_rank0torchft_lighthousehttp://localhost:29510 config_namedemo_train exportTOKENIZERS_PARALLELISMfalse TOKENIZERS_PARALLELISMfalse PYTORCH_CUDA_ALLOC_CONFexpandable_segments:True TORCHFT_LIGHTHOUSEhttp://localhost:29510 python-mtorch.distributed.run--nproc_per_node8--local-ranks-filter0--master_port29501--tee3-mwan_va.train --config-name demo_train ***************************************** Setting OMP_NUM_THREADS environment variableforeach process to be1indefault, to avoid your system being overloaded, please further tune the variableforoptimal performanceinyour application as needed. *****************************************[default0]:2026-08-20 08:47:15,143 - root - INFO - Using config: demo_train[default0]:2026-08-20 08:47:15,143 - root - INFO - World size:8, Local rank:0[default0]:2026-08-20 08:47:15,143 - root - INFO - Loading models...[default0]:2026-08-20 08:47:15,143 - root - INFO - Loading transformer...[default0]:[default0]:Loading checkpoint shards:0%||0/3[00:00?, ?it/s][default0]:[default0]:Loading checkpoint shards:33%|███▎|1/3[00:0400:08,4.39s/it][default0]:[default0]:Loading checkpoint shards:67%|██████▋|2/3[00:0800:04,4.38s/it][default0]:[default0]:Loading checkpoint shards:100%|██████████|3/3[00:0900:00,2.60s/it][default0]:Loading checkpoint shards:100%|██████████|3/3[00:0900:00,3.08s/it][default0]:Some weights of the model checkpoint at /root/.cache/huggingface/hub/models--robbyant--lingbot-va-base/snapshots/68b7bc1b35da6ddc67ea94c4ceb58d768fbb3f9c/transformer were not used when initializing WanTransformer3DModel:[default0]:[patch_embedding.bias, patch_embedding.weight][default0]:2026-08-20 08:47:24,508 - root - INFO - Setting up activation checkpointing...[default0]:2026-08-20 08:47:24,509 - root - INFO - Setting up FSDP...[default0]:/opt/conda/envs/fastwam/lib/python3.10/site-packages/torch/distributed/distributed_c10d.py:4631: UserWarning: No deviceidis provided viainit_process_grouporbarrier.Using the current devicesetby the user.[default0]: warnings.warn(# warn only once[default0]:[rank0]:[W820 08:47:24.603213655 ProcessGroupNCCL.cpp:4718][PG ID0PG GUID0Rank0]using GPU0as device used by this process is currently unknown. This can potentially cause a hangifthis rank to GPU mapping is incorrect. You can pecify device_idininit_process_group()to force use of a particular device.[default0]:2026-08-20 08:47:30,594 - root - INFO - Setting up datasets...[default0]:[default0]:[default0]:Downloading data:100%|██████████|83/83[00:0000:00,8113.91files/s][default0]:[default0]:Generating train split:0examples[00:00, ? examples/s][default0]:[default0]:Generating train split:11913examples[00:00,116354.34examples/s][default0]:[default0]:Generating train split:18907examples[00:00,108320.72examples/s][default0]:2026-08-20 08:47:34,877 - root - INFO - Starting trainingfor2000steps...[default0]:[default0]:Training:0%||0/2000[00:00?, ?it/s][default0]:[default0]:Training:0%||1/2000[01:5362:58:00,113.40s/it,latent_loss0.2660,action_loss0.2788,step0,grad_norm1.23,lr1.00e-05][default0]:[default0]:Training:0%||2/2000[02:2440:10:18,72.38s/it,latent_loss0.2626,action_loss0.2646,step1,grad_norm1.18,lr2.00e-05][default0]:[default0]:Training:0%||3/2000[02:5532:23:50,58.40s/it,latent_loss0.2637,action_loss0.2428,step2,grad_norm1.01,lr3.00e-05]训练正常启动后save_interval默认 50 步触发一次 checkpoint写在save_root/checkpoints/checkpoint_step_xxx/transformer/下每一步进度条都会打印latent_loss、action_loss、梯度范数grad_norm和学习率lr。