使用bazel构建tensorflow服务时swig_import_helper和PyModule_Create2出错

时间:2016-08-06 20:31:34

标签: tensorflow bazel tensorflow-serving

我试图使用bazel安装tensorflow-serving,当我运行时

bazel build tensorflow_serving/... 

构建源代码树,我收到此错误:

ERROR: /home/saad/.cache/bazel/_bazel_saad/e37842e738e0e762fe833f8c0caa8761/external/org_tensorflow/tensorflow/contrib/session_bundle/example/BUILD:38:1: Executing genrule @org_tensorflow//tensorflow/contrib/session_bundle/example:half_plus_two failed: bash failed: error executing command /bin/bash -c ... (remaining 1 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
Traceback (most recent call last):
  File "/home/saad/.cache/bazel/_bazel_saad/e37842e738e0e762fe833f8c0caa8761/execroot/serving/bazel-out/host/bin/external/org_tensorflow/tensorflow/contrib/session_bundle/example/export_half_plus_two.runfiles/tf_serving/../org_tensorflow/tensorflow/contrib/session_bundle/example/export_half_plus_two.py", line 32, in <module>
    import tensorflow as tf
  File "/home/saad/.cache/bazel/_bazel_saad/e37842e738e0e762fe833f8c0caa8761/execroot/serving/bazel-out/host/bin/external/org_tensorflow/tensorflow/contrib/session_bundle/example/export_half_plus_two.runfiles/org_tensorflow/tensorflow/__init__.py", line 23, in <module>
    from tensorflow.python import *
  File "/home/saad/.cache/bazel/_bazel_saad/e37842e738e0e762fe833f8c0caa8761/execroot/serving/bazel-out/host/bin/external/org_tensorflow/tensorflow/contrib/session_bundle/example/export_half_plus_two.runfiles/org_tensorflow/tensorflow/python/__init__.py", line 48, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/home/saad/.cache/bazel/_bazel_saad/e37842e738e0e762fe833f8c0caa8761/execroot/serving/bazel-out/host/bin/external/org_tensorflow/tensorflow/contrib/session_bundle/example/export_half_plus_two.runfiles/org_tensorflow/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
    _pywrap_tensorflow = swig_import_helper()
  File "/home/saad/.cache/bazel/_bazel_saad/e37842e738e0e762fe833f8c0caa8761/execroot/serving/bazel-out/host/bin/external/org_tensorflow/tensorflow/contrib/session_bundle/example/export_half_plus_two.runfiles/org_tensorflow/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
ImportError: /home/saad/.cache/bazel/_bazel_saad/e37842e738e0e762fe833f8c0caa8761/execroot/serving/bazel-out/host/bin/external/org_tensorflow/tensorflow/contrib/session_bundle/example/export_half_plus_two.runfiles/org_tensorflow/tensorflow/python/_pywrap_tensorflow.so: undefined symbol: PyModule_Create2

我该怎么办?

我正在运行python 3.5,gcc / g ++ 4.9,CUDA 8.0,安装了swig,我正在尝试使用GTX 1080构建Ubuntu Mate 16.04。

谢谢!

0 个答案:

没有答案