1.首先安装TensorRT
pip install tensorrt
2.找到tensorrt_libs
目录,一般在~/.local/lib/python3.10/site-packages/tensorrt_libs/
。目录下可以看到libnvinfer.so.8
等文件
注:有些教程说的是tensorrt
目录,但是我在这个目录下面没找到文件
3.创建symbol links,这样TensorFlow才能找到对应的链接库文件
ln -s libnvinfer.so.8 libnvinfer.so.7
ln -s libnvinfer_plugin.so.8 libnvinfer_plugin.so.7
4.最后,要把路径加到export LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.local/lib/python3.10/site-packages/tensorrt_libs/
标签:load,LD,Could,dynamic,tensorrt,LIBRARY,libnvinfer,so.7,PATH
From: https://www.cnblogs.com/yaos/p/17859452.html