安裝ONNX_tensorrt


1 TensotRT7 安裝  ONNX_tensorrt教程

 

1 git clone --recursive -b 7.0 https://github.com/onnx/onnx-tensorrt.git

2 cd onnx-tensorrt

3 mkdir build

4 cd build

5 cmake .. -DTENSORRT_ROOT=<tensorrt_install_dir> -DGPU_ARCHS="61"

這一步可能報錯:

Could NOT find Protobuf (missing: Protobuf_INCLUDE_DIR)

解決辦法:sudo apt-get install libprotobuf-dev protobuf-compiler

 

6 make -j 12

make -j 12
這一步如果報錯
numeric_limits’ is not a member of ‘std’

表示出錯的onnx_utils.hpp頭文件沒有包含

#include <stdexcept> #include <limits>

 7 sudo make install 

 

 

2 TensotRT4 安裝  ONNX_tensorrt5.1教程

1 git clone --recursive -b v5.0 https://github.com/onnx/onnx-tensorrt.git 

2 cd onnx-tensorrt

3 mkdir build

4 cd build

5 cmake .. -DTENSORRT_ROOT=<tensorrt_install_dir> -DGPU_ARCHS="61"

可能報錯:

onnx-tensorrt:builtin_op_importers.cpp:628:5: error: ‘IIdentityLayer’ is not a member of ‘nvinfer1’

解決方法:

如果在TensorRT 4.0上編譯,就有這個錯誤;5.0就沒有(集成了)。

因此注釋報錯代碼所在的整個函數,重新編譯即可。

6 make -j8

 7 sudo make install 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM