zoukankan      html  css  js  c++  java
  • 安装TensorRT

    下载对应的tar版本:https://developer.nvidia.com/nvidia-tensorrt-6x-download

    1. 解压安装包
    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
    
    1. 解压得到TensorRT-6.0.1.8的文件夹,将里边的lib绝对路径添加到环境变量中
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/qian/TensorRT-6.0.1.8/lib
    
    1. 安装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
    
    1. 安装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
    
    1. 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
    
    
    1. 为了避免后边deepstream找不到tensorrt的库,建议把tensorrt的库和头文件添加到系统路径下
    # TensorRT路径下
    sudo cp -r ./lib/* /usr/lib
    sudo cp -r ./include/* /usr/include
    
    1. 如果要使用python接口的tensorrt,则需要安装pycuda
    pip install 'pycuda>=2019.1.1'
    
    1. 测试
    cd ~/TensorRT-6.0.1.8/samples/
    sudo make
    cd ../bin
    ./sample_int8 mnist
    
  • 相关阅读:
    7.9 C++ STL算法
    7.8 C++容器适配器
    7.7 C++基本关联式容器
    Django项目静态文件加载失败问题
    Centos6.5安装mysql5.7详解
    使用Xshell上传下载文件
    linux中MySQL本地可以连接,远程连接不上问题
    Linux常用命令
    Linux环境安装python3
    python 字符串最长公共前缀
  • 原文地址:https://www.cnblogs.com/long5683/p/13360651.html
Copyright © 2011-2022 走看看