# LeRobot策略缺失ONNX/TensorRT导出，SmolVLA可用reflex-vla绕过

> 原文链接：https://robotics.hellobike.com/pitfalls/2026-11-23-lerobot-3146
> 频道：pitfalls | 更新日期：2026-11-23 | 标签：auto, github-issue, lerobot
> 核心摘要：针对LeRobot缺乏原生ONNX/TRT导出问题，可使用reflex-vla工具链实现SmolVLA等模型的FP16 TRT部署与精度对齐。

# LeRobot策略缺失ONNX/TensorRT导出，SmolVLA可用reflex-vla绕过

::: v-pre
> 本文由 AI 根据公开内容整理，可能有误，请以原文为准：[Feature: ONNX / TensorRT export for trained policies](https://github.com/huggingface/lerobot/issues/3146)（GitHub huggingface/lerobot #3146）

**状态**：有绕过办法

## 问题

LeRobot框架目前不支持将ACT、Diffusion Policy或VLA模型导出为ONNX/TensorRT格式，导致在Jetson Orin Nano等资源受限设备上PyTorch推理过慢。手动使用`torch.onnx.export`面临Action Chunking和Denoising Loop处理困难，且在Orin Nano（sm_87）上使用INT8/FP8会因缺少Tensor Core而失败或回退。

## 环境

NVIDIA Jetson Orin Nano/NX (sm_87), LeRobot框架, ACT/Diffusion/SmolVLA/Pi0策略模型, TensorRT, ONNX Runtime

## 解决办法

1. 使用开源项目 `reflex-vla` (github.com/FastCrest/reflex-vla) 作为替代导出与部署方案，该项目支持SmolVLA、Pi0、Pi0.5及GR00t模型。
2. 采用该工具提供的Monolithic ONNX导出流程，其内置了针对`torch.export`的补丁以修复KV Cache布线、正弦嵌入及图像维度不匹配问题。
3. 配置TensorRT时务必指定FP16精度，避免在Orin Nano/NX上使用INT8或FP8，防止构建失败或性能回退。
4. 对于Diffusion Policy，建议仅导出UNet并将Scheduler保留在Python端，或使用固定Horizon Trace完整K-step循环以换取TRT加速。
5. 部署时使用项目提供的PyTorch-free I/O-Binding Runner及JetPack `trtexec` 脚本进行静态Shape推理。
6. 通过Cosine Similarity校验导出模型与Py…

讨论原作者：@jashshah999 等，版权归原作者所有。
:::

## 原始参考来源 (Sources)

- [GitHub huggingface/lerobot #3146：Feature: ONNX / TensorRT export for trained policies](https://github.com/huggingface/lerobot/issues/3146)