블로그

[파이썬] Tensorflow2.x libnvinfer.so.6 libnvinfer_plugin.so.6 error

(venv) # python
Python 3.6.9 (default, Nov  7 2019, 10:44:02) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
2020-04-08 23:35:08.741410: 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
2020-04-08 23:35:08.741638: 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
2020-04-08 23:35:08.741660: 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.

위와 같은 에러는 gpu 가 없는 서버에서 gpu 를 찾아서 발생하는 에러입니다. 텐서플로우 2.1 에서는 기본적으로

gpu 버전이 설치가 되니 cpu 버전을 설치를 따로 해 줘야 합니다.

# pip install tensorflow-cpu

Collecting tensorflow-cpu
  Downloading tensorflow_cpu-2.1.0-cp36-cp36m-manylinux2010_x86_64.whl (104.6 MB)
     |████████████████████████████████| 104.6 MB 36 kB/s
Requirement already satisfied: grpcio>=1.8.6 in ./venv/lib/python3.6/site-packages (from tensorflow-cpu) (1.28.1)
Requirement already satisfied: numpy<2.0,>=1.16.0 in ./venv/lib/python3.6/site-packages (from tensorflow-cpu) (1.18.2)
Requirement already satisfied: keras-applications>=1.0.8 in ./venv/lib/python3.6/site-packages (from tensorflow-cpu) (1.0.8)
Requirement already satisfied: tensorflow-estimator<2.2.0,>=2.1.0rc0 in ./venv/lib/python3.6/site-packages (from tensorflow-cpu) (2.1.0)
Requirement already satisfied: wheel>=0.26; python_version >= "3" in ./venv/lib/python3.6/site-packages (from tensorflow-cpu) (0.34.2)
Requirement already satisfied: tensorboard<2.2.0,>=2.1.0 in ./venv/lib/python3.6/site-packages (from tensorflow-cpu) (2.1.1)
Requirement already satisfied: wrapt>=1.11.1 in ./venv/lib/python3.6/site-packages (from tensorflow-cpu) (1.12.1)
Requirement already satisfied: gast==0.2.2 in ./venv/lib/python3.6/site-packages (from tensorflow-cpu) (0.2.2)
Requirement already satisfied: keras-preprocessing>=1.1.0 in ./venv/lib/python3.6/site-packages (from tensorflow-cpu) (1.1.0)
Requirement already satisfied: google-pasta>=0.1.6 in ./venv/lib/python3.6/site-packages (from tensorflow-cpu) (0.2.0)
Requirement already satisfied: termcolor>=1.1.0 in ./venv/lib/python3.6/site-packages (from tensorflow-cpu) (1.1.0)
Requirement already satisfied: opt-einsum>=2.3.2 in ./venv/lib/python3.6/site-packages (from tensorflow-cpu) (3.2.0)
Requirement already satisfied: six>=1.12.0 in ./venv/lib/python3.6/site-packages (from tensorflow-cpu) (1.14.0)
Requirement already satisfied: absl-py>=0.7.0 in ./venv/lib/python3.6/site-packages (from tensorflow-cpu) (0.9.0)
Requirement already satisfied: astor>=0.6.0 in ./venv/lib/python3.6/site-packages (from tensorflow-cpu) (0.8.1)
Requirement already satisfied: protobuf>=3.8.0 in ./venv/lib/python3.6/site-packages (from tensorflow-cpu) (3.11.3)
Requirement already satisfied: scipy==1.4.1; python_version >= "3" in ./venv/lib/python3.6/site-packages (from tensorflow-cpu) (1.4.1)
Requirement already satisfied: h5py in ./venv/lib/python3.6/site-packages (from keras-applications>=1.0.8->tensorflow-cpu) (2.10.0)
Requirement already satisfied: werkzeug>=0.11.15 in ./venv/lib/python3.6/site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow-cpu) (1.0.1)    
Requirement already satisfied: markdown>=2.6.8 in ./venv/lib/python3.6/site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow-cpu) (3.2.1)
Requirement already satisfied: google-auth<2,>=1.6.3 in ./venv/lib/python3.6/site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow-cpu) (1.13.1)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in ./venv/lib/python3.6/site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow-cpu) (0.4.1)
Requirement already satisfied: setuptools>=41.0.0 in ./venv/lib/python3.6/site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow-cpu) (46.1.3)
Requirement already satisfied: requests<3,>=2.21.0 in ./venv/lib/python3.6/site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow-cpu) (2.23.0)
Requirement already satisfied: rsa<4.1,>=3.1.4 in ./venv/lib/python3.6/site-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow-cpu) (4.0)
Requirement already satisfied: cachetools<5.0,>=2.0.0 in ./venv/lib/python3.6/site-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow-cpu) (4.0.0)
Requirement already satisfied: pyasn1-modules>=0.2.1 in ./venv/lib/python3.6/site-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow-cpu) (0.2.8)
Requirement already satisfied: requests-oauthlib>=0.7.0 in ./venv/lib/python3.6/site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.2.0,>=2.1.0->tensorflow-cpu) (1.3.0)
Requirement already satisfied: chardet<4,>=3.0.2 in ./venv/lib/python3.6/site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow-cpu) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in ./venv/lib/python3.6/site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow-cpu) (1.25.8)
Requirement already satisfied: idna<3,>=2.5 in ./venv/lib/python3.6/site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow-cpu) (2.9)
Requirement already satisfied: certifi>=2017.4.17 in ./venv/lib/python3.6/site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow-cpu) (2019.11.28)
Requirement already satisfied: pyasn1>=0.1.3 in ./venv/lib/python3.6/site-packages (from rsa<4.1,>=3.1.4->google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow-cpu) (0.4.8)
Requirement already satisfied: oauthlib>=3.0.0 in ./venv/lib/python3.6/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.2.0,>=2.1.0->tensorflow-cpu) (3.1.0)
Installing collected packages: tensorflow-cpu
Successfully installed tensorflow-cpu-2.1.0