tensorrt安装教程
时间: 2023-12-01 21:04:00 浏览: 258
TensorRT安装
以下是TensorRT的安装教程:
1. 下载tar包
TensorRT官方API提供了四种安装方式,建议下载tar包进行安装。下载地址https://developer.nvidia.com/tensorrt
2. 安装依赖
```shell
sudo apt-get update
sudo apt-get install -y python-dev python-pip python3-dev python3-pip
sudo apt-get install -y libnvinfer5 libnvinfer-dev libnvparsers5 libnvparsers-dev libnvonnxparsers5 libnvonnxparsers-dev libnvinfer-plugin5 libnvinfer-plugin-dev libnvcaffe_parser5 libnvcaffe_parser-dev
```
3. 安装TensorRT
```shell
sudo dpkg -i nv-tensorrt-repo-ubuntu1604-cuda10.0-trt5.1.5.0-ga-20190427_1-1_amd64.deb
sudo apt-key add /var/nv-tensorrt-repo-cuda10.0-trt5.1.5.0-ga-20190427/7fa2af80.pub
sudo apt-get update
sudo apt-get install tensorrt
sudo apt-get install python3-libnvinfer-dev
```
4. 验证安装
```shell
dpkg -l | grep TensorRT
```
5. 安装UFF
```shell
sudo pip3 install --pre --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v42 tensorflow-gpu==1.15.0+nv20.3
sudo pip3 install --pre --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v42 tensorrt==5.1.5.0
sudo pip3 install graphsurgeon-0.4.1-py2.py3-none-any.whl uff-0.6.5-py2.py3-none-any.whl
```
6. 验证UFF安装
```shell
python3 -c 'import uff; print(uff.__version__)'
```
阅读全文