Open zzzzzyh111 opened 3 months ago
在linux arm64平台默认pip安装的onnxruntime-gpu是通过tensorrt加速的(参考 https://onnxruntime.ai/getting-started ),如果是这样安装的话,和直接使用tensorrt再简单地导出个模型推理的性能基本一致,尤其是python的推理。
此外相比于桌面端GPU,tensorrt对orin上int8的推理加速效果较fp16提升较为明显,实际部署的话最好是可以进行int8量化或者8-16混合精度量化
谢谢您的回答,但我发现其实tensorrt和pth的推理速度也是基本一样的,因此: 1.我估计代码里的data loading和 preprocessing部分可能占了大部分时间,我会进一步打印每一步的时间并查找究竟是哪一部分耗时最久 2.关于使用Int8量化加速的提议非常好,但是我的任务对精度要求比较高,所以可能只会在目前情况得不到改善的前提下再考虑使用
感谢您的快速答复!
感谢您的优秀工作! 最近我在尝试在Jetson Orign NX上使用TensorRT对Depth Anything进行加速,但是我发现转换后的trt文件的推理速度和onnx文件相比并没有显著提升,甚至还有下降。其中:
库的版本如下:
将pth文件转换成onnx文件的函数如下:
将onnx文件转换成trt文件的函数如下:
使用trt文件进行推理的函数如下:
代码运行过程中除了转换成onnx文件的时候会有一些warning,其他全部正常运行。但是最后的结果还是不尽如人意,期待得到您的回复!