我正在尝试使用Tensorflow运行用于对象检测的代码,但运行时出现以下错误。
>protoc object_detection/protos/*.proto --python_out=.
>export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim
>python object_detection/builders/model_builder_test.py
Traceback (most recent call last):
File "object_detection/builders/model_builder_test.py", line 20, in <module>
import tensorflow as tf
File "/home/dora/.local/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "/home/dora/.local/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/dora/.local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/home/dora/.local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/dora/.local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/dora/.local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
答案 0 :(得分:2)
它与GPU库有关。确保已安装CUDA 10.0,并按照所有步骤安装tensorflow-gpu
cuda文件夹中缺少libcublas.so.10.0文件。请确保该文件位于安装文件夹中,并确保该文件位于路径中