TRTEXEC 与 ActionRecognitionNet
trtexec
工具是一个命令行封装,作为 TensorRT 示例的一部分包含在内。TAO 5.0.0 在 TAO Deploy
容器(或通过启动器运行时为任务组)中公开了 trtexec
工具,用于在基于 x86 的 CPU 和独立 GPU 上部署模型。要在其他平台(例如 Jetson 设备)上或使用 TAO 容器中默认不使用的 TensorRT 版本运行 trtexec
,您可以按照 官方 TensorRT 文档了解如何获取 trtexec。
本节介绍如何使用 trtexec
生成 TensorRT 引擎,这允许您在 TensorRT、Triton 和 Deepstream 上部署 TAO 训练的模型。
要为 ActionRecognitionNet 生成 .onnx
文件,请参阅 ActionRecognitionNet 文档。ActionRecognitionNet 目前不支持 INT8 校准。
# convert 2D RGB model with input sequence length is 32 and input size is 224x224
trtexec --onnx=/path/to/model.onnx \
--maxShapes=input_rgb:16x3x96x224x224 \
--minShapes=input_rgb:1x3x96x224x224 \
--optShapes=input_rgb:4x3x96x224x224 \
--fp16 \
--saveEngine=/path/to/save/trt/model.engine
# convert 3D RGB model with input sequence length is 32 and input size is 224x224:
trtexec --onnx=/path/to/model.onnx \
--maxShapes=input_rgb:16x3x32x224x224 \
--minShapes=input_rgb:1x3x32x224x224 \
--optShapes=input_rgb:4x3x32x224x224 \
--fp16 \
--saveEngine=/path/to/save/trt/model.engine
# convert 2D optical-flow model with input sequence length is 32 and input size is 224x224
trtexec --onnx=/path/to/model.onnx \
--maxShapes=input_of:16x3x64x224x224 \
--minShapes=input_of:1x3x64x224x224 \
--optShapes=input_of:4x3x64x224x224 \
--fp16 \
--saveEngine=/path/to/save/trt/model.engine
# convert 3D optical-flow model with input sequence length is 32 and input size is 224x224:
trtexec --onnx=/path/to/model.onnx \
--maxShapes=input_of:16x2x32x224x224 \
--minShapes=input_of:1x2x32x224x224 \
--optShapes=input_of:4x2x32x224x224 \
--fp16 \
--saveEngine=/path/to/save/trt/model.engine