运行一个py文件,出现如下的错误,原因是没有找到 libnvinfer.so.6 相关库的文件。
1 2021-01-04 18:41:17.324477: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library \'libnvinfer.so.6\'; dlerror: libnvinfer.so.6: cannot open shared object file: No such file or directory 2 2021-01-04 18:41:17.324584: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library \'libnvinfer_plugin.so.6\'; dlerror: libnvinfer_plugin.so.6: cannot open shared object file: No such file or directory 3 2021-01-04 18:41:17.324607: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:30] Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
解决方案:使用 pip 安装 tensorflow-cpu 。
1 pip install tensorflow-cpu -i https://pypi.tuna.tsinghua.edu.cn/simple
相关参考:issues#35968,issues#36201