linux安装onnx2trt的方法
# 下载
git clone --recursive https://github.com/onnx/onnx-tensorrt.git
# 查看分支
git tag
# 切换分支,与tensorRT版本一致
git checkout release/8.2-GA
# 或者直接下载 https://codeload.github.com/onnx/onnx-tensorrt/zip/refs/heads/8.2-GA
wget https://github.com/onnx/onnx/releases/download/v1.6.0/onnx-1.6.0.tar.gz
tar -xzvf onnx-1.6.0.tar.gz
mv onnx-1.6.0 onnx
mkdir build
cd build
cmake .. -DTENSORRT_ROOT=../TensorRT-8.1.3.6 -DGPU_ARCHS="75"
make -j6
sudo make install
环境配置:
gedit ~/.bashrc
# onnx_tensorrt版本可以添加到相应工程编译文件中
export PATH=/home/***/onnx-tensorrt/build/installed/bin:$PATH
export LD_LIBARARY_PATH=/home/***/onnx-tensorrt/build/installed/lib:$LD_LIBARARY_PATH
source ~/.bashrc
onnx2trt -V