TRTEXEC 搭配 Classification TF1/TF2/PyT
trtexec
工具是一个命令行封装程序,包含在 TensorRT 示例中。TAO 5.0.0 在 TAO Deploy
容器(或通过启动器运行时为任务组)中公开了 trtexec
工具,以便使用基于 x86 的 CPU 和独立 GPU 部署模型。要在其他平台(例如 Jetson 设备)上或在 TAO 容器中默认未使用的 TensorRT 版本中使用 trtexec
,您可以参考 官方 TensorRT 文档,了解如何获取 trtexec。
本节介绍如何使用 trtexec
生成 TensorRT 引擎,这使您能够在 TensorRT、Triton 和 Deepstream 上部署 TAO 训练的模型。
要为 Classification TF1/TF2/PyT 生成 .onnx
文件,请参阅分类文档。您还可以参考 Classification TAO-Deploy 文档,以获取有关生成 INT8 校准文件的说明。
trtexec --onnx=/path/to/model.onnx \
--maxShapes=input_1:64x3x224x224 \
--minShapes=input_1:1x3x224x224 \
--optShapes=input_1:32x3x224x224 \
--calib=/path/to/int8/calib.txt \
--fp16 \
--int8 \
--saveEngine=/path/to/save/trt/model.engine