serving: NotFoundError in mnist_export example

Hello, I’m trying tensorflow_serving according to the doc . The build and test have passed.

While

bazel build //tensorflow_serving/example:mnist_export

succeeds,

bazel-bin/tensorflow_serving/example/mnist_export /tmp/mnist_model

fails and shows the error message as below.

Traceback (most recent call last):
  File "/home/usr/serving/bazel-bin/tensorflow_serving/example/mnist_export.runfiles/tf_serving/tensorflow_serving/example/mnist_export.py", line 36, in <module>
    from tensorflow.contrib.session_bundle import exporter
  File "/home/usr/serving/bazel-bin/tensorflow_serving/example/mnist_export.runfiles/org_tensorflow/tensorflow/contrib/__init__.py", line 34, in <module>
    from tensorflow.contrib import image
  File "/home/usr/serving/bazel-bin/tensorflow_serving/example/mnist_export.runfiles/org_tensorflow/tensorflow/contrib/image/__init__.py", line 39, in <module>
    from tensorflow.contrib.image.python.ops.single_image_random_dot_stereograms import single_image_random_dot_stereograms
  File "/home/usr/serving/bazel-bin/tensorflow_serving/example/mnist_export.runfiles/org_tensorflow/tensorflow/contrib/image/python/ops/single_image_random_dot_stereograms.py", line 26, in <module>
    "_single_image_random_dot_stereograms.so"))
  File "/home/usr/serving/bazel-bin/tensorflow_serving/example/mnist_export.runfiles/org_tensorflow/tensorflow/contrib/util/loader.py", line 55, in load_op_library
    ret = load_library.load_op_library(path)
  File "/home/usr/serving/bazel-bin/tensorflow_serving/example/mnist_export.runfiles/org_tensorflow/tensorflow/python/framework/load_library.py", line 64, in load_op_library
    None, None, error_msg, error_code)
tensorflow.python.framework.errors_impl.NotFoundError: /home/usr/serving/bazel-bin/tensorflow_serving/example/mnist_export.runfiles/org_tensorflow/tensorflow/contrib/image/python/ops/_single_image_random_dot_stereograms.so: undefined symbol: _ZN6google8protobuf8internal10LogMessageC1ENS0_8LogLevelEPKci

I use VirtualBox and the guest OS is Ubuntu 16.04 and the host OS is the latest macOS.

Thank you.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 25 (3 by maintainers)

Commits related to this issue

Most upvoted comments

FWIW - if this is a blocking issue for anyone, it can be temporarily worked around by commenting out the single_image_random_dot_stereograms import from the images/init.py in the headers used to compile serving. Not ideal - but it gets it working for the moment.

@Shoshin23 I actually managed to find it in runfiles that were build by bazel For example here:

bazel-bin/tensorflow_serving/example/*INSERT_NAME*.runfiles/org_tensorflow/tensorflow/contrib/image/__init__.py

Open it and comment the line as @ashern suggested. Btw, thanks @ashern, that works for me!

has solved!
comment out #from tensorflow.contrib.image.python.ops.single_image_random_dot_stereograms import single_image_random_dot_stereograms in bazel-bin/tensorflow_serving/example/mnist_saved_model.runfiles/org_tensorflow/tensorflow/contrib/image/init.py

Commenting out

#from tensorflow.contrib.image.python.ops.single_image_random_dot_stereograms import single_image_random_dot_stereograms

in

bazel-bin/tensorflow_serving/example/mnist_saved_model.runfiles/org_tensorflow/tensorflow/contrib/image/init.py

worked for me as well. Thanks!

@MtDersvan thank you for your reply my tensorflow version is r1.4 and finally I found the reason is my bazel version is 0.9.0 result in this problem. bazel 0.8.1 worked for me!

the problem reason is single_image_random_dot_stereograms.cc<<kernels>> be dependent on TensorShapeProto it define on protobuf, use class LogMessage. but no deps protobuf on BUILD rule python/ops/_single_image_random_dot_stereograms.so . so Symbol not found: __ZN6google8protobuf8internal10LogMessageC1ENS0_8LogLevelEPKci(google::protobuf::internal::LogMessage::LogMessage)

same problem in Ubuntu 16.04 and comment out

#from tensorflow.contrib.image.python.ops.single_image_random_dot_stereograms import single_image_random_dot_stereograms

in bazel-bin/tensorflow_serving/example/mnist_saved_model.runfiles/org_tensorflow/tensorflow/contrib/image/__init__.py as @ashern mentioned, it works.

Also, I’m facing the exact same issue when i try to deploy an inception model with docker and kubernetes as described in the tensorflow serving docs.