tensorrt5版本_安装TensorRT

解压安装包

version="6.0.1.8"

os="Ubuntu-16.04"

arch=$(uname -m)

cuda="cuda-10.2"

cudnn="cudnn7.6"

tar xzvf TensorRT-${version}.${os}.${arch}-gnu.${cuda}.${cudnn}.tar.gz

解压得到TensorRT-6.0.1.8的文件夹,将里边的lib绝对路径添加到环境变量中

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/qian/TensorRT-6.0.1.8/lib

安装TensorRT

cd TensorRT-${version}/python

# If using Python 2.7:

sudo pip2 install tensorrt-*-cp27-none-linux_x86_64.whl

# If using Python 3.x:

sudo pip3 install tensorrt-*-cp3x-none-linux_x86_64.whl

安装Python UFF wheel文件。仅当计划将TensorRT与TensorFlow一起使用时,才需要此选项。

cd TensorRT-${version}/uff

# If using Python 2.7:

sudo pip2 install uff-0.6.9-py2.py3-none-any.whl

# If using Python 3.x:

sudo pip3 install uff-0.6.9-py2.py3-none-any.whl

# In either case, check the installation with:

which convert-to-uff

Install the Python graphsurgeon wheel file.

cd TensorRT-${version}/graphsurgeon

# If using Python 2.7:

sudo pip2 install graphsurgeon-0.4.5-py2.py3-none-any.whl

# If using Python 3.x:

sudo pip3 install graphsurgeon-0.4.5-py2.py3-none-any.whl

为了避免后边deepstream找不到tensorrt的库,建议把tensorrt的库和头文件添加到系统路径下

# TensorRT路径下

sudo cp -r ./lib/* /usr/lib

sudo cp -r ./include/* /usr/include

如果要使用python接口的tensorrt,则需要安装pycuda

pip install ‘pycuda>=2019.1.1‘

测试

cd ~/TensorRT-6.0.1.8/samples/

sudo make

cd ../bin

./sample_int8 mnist

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值