1、ImportError:libnvinfer.so5:cannot open shared object fil: no such file or directory.
解决方案:sudo cp TensorRT-5.XXX/targets/x86_64-linux-gnu/lib/lib* /usr/lib
2、ImportError: /home/xxx/anaconda3/lib/python3.6/site-packages/tensorrt/tensorrt.so: undefined symbol: _Py_ZeroStruct
我也参考了这个链接,但是没用
https://blog.csdn.net/sinat_21720047/article/details/84447350
我查看了tensorrt的安装位置
~/anaconda3/envs/py35/lib/python3.5/site-packages/tensorrt
发现里面有:
tensorrt.cpython-36m-x86_64-linux-gnu.so*
tensorrt.so*
看样子这两个文件使用了ubuntu18.0自带的python3.6
我虽然使用which pip查看了pip的确是annaconda 环境下的pip,但是不知到为啥会调用系统的python
下一步需要跟深入了解下pip, anaconda,python的关系后再更新此问题
暂时的解决办法:使用tensorrt的python接口时,暂时使用系统的python3.6