No module named 'graphsurgeon--如何正确安装TensorRT?

No module named 'graphsurgeon

Note: Before issuing the following commands, you'll need to replace 5.1.x.x with your specific TensorRT version. The following commands are examples.

  1. Install the following dependencies, if not already present:
    • Install the CUDA Toolkit 9.0, 10.0 or 10.1
    • cuDNN 7.5.0
    • Python 2 or Python 3 (Optional)
  2. Download the TensorRT tar file that matches the Linux distribution you are using.
  3. Choose where you want to install TensorRT. This tar file will install everything into a subdirectory called TensorRT-5.1.x.x.
  4. Unpack the tar file.
    $ tar xzvf TensorRT-5.1.x.x.Ubuntu-1x.04.x.x86_64-gnu.cuda-x.x.cudnn7.x.tar.gz
    Where:
    • 5.1.x.x is your TensorRT version
    • Ubuntu-1x.04.x is 14.04.5, 16.04.4 or 18.04.1
    • cuda-x.x is CUDA version 9.0, 10.0, or 10.1
    • cudnn7.x is cuDNN version 7.5
    This directory will have sub-directories like lib, include, data, etc…
    $ ls TensorRT-5.1.x.x
    bin  data  doc  graphsurgeon  include  lib  python  samples  targets  TensorRT-Release-Notes.pdf  uff
    
  5. Add the absolute path to the TensorRT lib directory to the environment variable LD_LIBRARY_PATH:
    $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<eg:TensorRT-5.1.x.x/lib>
  6. Install the Python TensorRT wheel file.
    $ cd TensorRT-5.1.x.x/python

     

    If using Python 2.7:
    $ sudo pip2 install tensorrt-5.1.x.x-cp27-none-linux_x86_64.whl

     

    If using Python 3.x:
    $ sudo pip3 install tensorrt-5.1.x.x-cp3x-none-linux_x86_64.whl
  7. Install the Python UFF wheel file. This is only required if you plan to use TensorRT with TensorFlow.
    $ cd TensorRT-5.1.x.x/uff

     

    If using Python 2.7:
    $ sudo pip2 install uff-0.6.3-py2.py3-none-any.whl

     

    If using Python 3.x:
    $ sudo pip3 install uff-0.6.3-py2.py3-none-any.whl

     

    In either case:
    $ which convert-to-uff
    /usr/local/bin/convert-to-uff
    
  8. Install the Python graphsurgeon wheel file.
    $ cd TensorRT-5.1.x.x/graphsurgeon

     

    If using Python 2.7:
    $ sudo pip2 install graphsurgeon-0.4.1-py2.py3-none-any.whl
    

     

    If using Python 3.x:
    $ sudo pip3 install graphsurgeon-0.4.1-py2.py3-none-any.whl
    
  9. Verify the installation:
    1. Ensure that the installed files are located in the correct directories. For example, run the tree -d command to check whether all supported installed files are in place in the lib, include, data, etc… directories.
    2. Build and run one of the shipped samples, for example, sampleMNIST in the installed directory. You should be able to compile and execute the sample without additional settings. For more information about sampleMNSIT, see the TensorRT Sample Support Guide.
    3. The Python samples are in the samples/python direc
  10. python包一定安装,在使用python API转换tensorflow model的时候,会报错找不到graphsurgeon库.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

seasermy

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值