跳到主要内容

推理与评测

部署 LingBot-VA 进行推理​

LingBot-VA 同时支持独立运行(standalone execution)以及将模型环境与仿真分离的服务器-客户端(Server-Client)架构。通过隔离依赖,该设计避免了包冲突,并支持在 GPU、集群以及其他设备上进行分布式推理。

在 RoboTwin-2.0 上评测​

准备环境

你可以参照原始 RoboTwin-2.0 仓库的官方说明:
https://robotwin-platform.github.io/doc/usage/robotwin-install.html

总结如下:

  1. 安装 Vulkan 依赖:

    sudo apt install libvulkan1 mesa-vulkan-drivers vulkan-tools
  2. 克隆 RoboTwin 仓库:

    git clone https://github.com/RoboTwin-Platform/RoboTwin.git && cd RoboTwin && git checkout 2eeec322
  3. 将 script/requirements.txt 修改为以下内容:

    transforms3d==0.4.2
    sapien==3.0.0b1
    scipy==1.10.1
    mplib==0.2.1
    gymnasium==0.29.1
    trimesh==4.4.3
    open3d==0.18.0
    imageio==2.34.2
    pydantic
    zarr
    openai
    huggingface_hub==0.36.2
    h5py
    # For Description Generation
    azure==4.0.0
    azure-ai-inference
    pyglet<2
    wandb
    moviepy
    imageio
    termcolor
    av
    matplotlib
    ffmpeg
  4. 修改 script/_install.sh 的第 8 行:

    pip install "git+https://github.com/facebookresearch/pytorch3d.git@stable" --no-build-isolation
  5. 安装依赖:

    bash script/_install.sh
  6. 下载资源文件:

    bash script/_download_assets.sh

部署推理服务器

# single GPU
bash evaluation/robotwin/launch_server.sh

# multi-GPU
bash evaluation/robotwin/launch_server_multigpus.sh

执行推理客户端

# single GPU
task_name="adjust_bottle";
save_root="results/";
bash evaluation/robotwin/launch_client.sh ${save_root} ${task_name}

# multi-GPU
save_root="results/"
task_group_id=0;
bash evaluation/robotwin/launch_client_multigpus.sh ${save_root} ${task_group_id}

相关实验结果将保存在 /path/to/your/RoboTwin/${save_root} 中。请注意,还会生成一个 eval_result 文件夹。这是 RoboTwin 的原生输出,与 results 文件夹中的内容完全相同,可以放心忽略。 需要特别说明的是,推理服务器和客户端必须部署在同一台机器上。对于启动多 GPU 客户端,我们通过复制将原始的 50 个任务填充到 56 个,并将其划分为 7 组,以匹配我们推理节点的 8-GPU 配置。你可以指定 task_group_id(0-6)来选择特定的一组进行推理。有关详细的分组配置,请参阅 evaluation/robotwin/launch_client_multigpus.sh。

GPU 显存需求:在启用 offload 模式(VAE 和 text_encoder 被卸载到 CPU)的情况下,单 GPU RoboTwin 评测约需 24GB 显存。

在 LIBERO 上评测​

按照官方说明安装 LIBERO,然后启动服务器和客户端:

# server
bash evaluation/libero/launch_server.sh

# client
bash evaluation/libero/launch_client.sh

运行图像到视频-动作生成​

图像到视频-动作生成使用以下脚本:

NGPU=1 CONFIG_NAME='robotwin_i2av' bash script/run_launch_va_server_sync.sh

GPU 显存需求:在启用 offload 模式(VAE 和 text_encoder 被卸载到 CPU)的情况下,单 GPU i2av 推理约需 18GB 显存。