serving icon indicating copy to clipboard operation
serving copied to clipboard

NotFoundError in mnist_export example

Open moskomule opened this issue 9 years ago • 25 comments

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.

moskomule avatar Apr 26 '17 09:04 moskomule

same error erli@berli-VirtualBox:~/serving$ bazel-bin/tensorflow_serving/example/mnist_saved_model /tmp/mnist_model Training model... Extracting /tmp/train-images-idx3-ubyte.gz Extracting /tmp/train-labels-idx1-ubyte.gz Extracting /tmp/t10k-images-idx3-ubyte.gz Extracting /tmp/t10k-labels-idx1-ubyte.gz 2017-04-27 14:40:07.078667: W external/org_tensorflow/tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations. 2017-04-27 14:40:07.078819: W external/org_tensorflow/tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. 2017-04-27 14:40:07.078877: W external/org_tensorflow/tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. WARNING:tensorflow:From /home/berli/serving/bazel-bin/tensorflow_serving/example/mnist_saved_model.runfiles/tf_serving/tensorflow_serving/example/mnist_saved_model.py:72: initialize_all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2017-03-02. Instructions for updating: Use tf.global_variables_initializer instead. Traceback (most recent call last): File "/home/berli/serving/bazel-bin/tensorflow_serving/example/mnist_saved_model.runfiles/tf_serving/tensorflow_serving/example/mnist_saved_model.py", line 140, in tf.app.run() File "/home/berli/serving/bazel-bin/tensorflow_serving/example/mnist_saved_model.runfiles/org_tensorflow/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "/home/berli/serving/bazel-bin/tensorflow_serving/example/mnist_saved_model.runfiles/tf_serving/tensorflow_serving/example/mnist_saved_model.py", line 77, in main prediction_classes = tf.contrib.lookup.index_to_string( File "/home/berli/serving/bazel-bin/tensorflow_serving/example/mnist_saved_model.runfiles/org_tensorflow/tensorflow/python/util/lazy_loader.py", line 53, in getattr module = self._load() File "/home/berli/serving/bazel-bin/tensorflow_serving/example/mnist_saved_model.runfiles/org_tensorflow/tensorflow/python/util/lazy_loader.py", line 42, in _load module = importlib.import_module(self.name) File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module import(name) File "/home/berli/serving/bazel-bin/tensorflow_serving/example/mnist_saved_model.runfiles/org_tensorflow/tensorflow/contrib/init.py", line 34, in from tensorflow.contrib import image File "/home/berli/serving/bazel-bin/tensorflow_serving/example/mnist_saved_model.runfiles/org_tensorflow/tensorflow/contrib/image/init.py", line 39, in from tensorflow.contrib.image.python.ops.single_image_random_dot_stereograms import single_image_random_dot_stereograms File "/home/berli/serving/bazel-bin/tensorflow_serving/example/mnist_saved_model.runfiles/org_tensorflow/tensorflow/contrib/image/python/ops/single_image_random_dot_stereograms.py", line 26, in "_single_image_random_dot_stereograms.so")) File "/home/berli/serving/bazel-bin/tensorflow_serving/example/mnist_saved_model.runfiles/org_tensorflow/tensorflow/contrib/util/loader.py", line 55, in load_op_library ret = load_library.load_op_library(path) File "/home/berli/serving/bazel-bin/tensorflow_serving/example/mnist_saved_model.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/berli/serving/bazel-bin/tensorflow_serving/example/mnist_saved_model.runfiles/org_tensorflow/tensorflow/contrib/image/python/ops/_single_image_random_dot_stereograms.so: undefined symbol: _ZN6google8protobuf8internal10LogMessageC1ENS0_8LogLevelEPKci

berli avatar Apr 27 '17 07:04 berli

I got the same error on the official Docker on macOS

moskomule avatar Apr 28 '17 09:04 moskomule

Joining the choir -

tensorflow.python.framework.errors_impl.NotFoundError: /home/asher/src/serving/bazel-bin/tensorflow_serving/example/inception_client.runfiles/org_tensorflow/tensorflow/contrib/image/python/ops/_single_image_random_dot_stereograms.so: undefined symbol: _ZN6google8protobuf8internal10LogMessageC1ENS0_8LogLevelEPKci

Tensorflow & Serving built from head vs both Python 2.7 & 3.5 get the same error.

ashern avatar Apr 28 '17 18:04 ashern

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.

ashern avatar May 01 '17 18:05 ashern

Can you tell me where this file is?

EDIT: I found it. tensorflow/tensorflow/contrib/image/init.py. I ran bazel clean after this and tried to build tensorflow serving again but it wouldnt work. It still shows the same error. Can anyone guide me as to how to fix this is?

Shoshin23 avatar May 08 '17 13:05 Shoshin23

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.

Shoshin23 avatar May 08 '17 13:05 Shoshin23

@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!

MtDersvan avatar May 09 '17 10:05 MtDersvan

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.

dongjk avatar May 11 '17 08:05 dongjk

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

zack6514 avatar May 25 '17 12:05 zack6514

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!

stephencwelch avatar May 26 '17 18:05 stephencwelch

Same issue here.

abrykt avatar May 29 '17 16:05 abrykt

:+1:

nkconnor avatar Jun 06 '17 11:06 nkconnor

Any news?

mahnunchik avatar Jun 12 '17 15:06 mahnunchik

Same issue here. I've installed tensorflow from source: CPU version with XLA enabled.

ankitachandak avatar Jun 26 '17 20:06 ankitachandak

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)

errord avatar Jul 24 '17 07:07 errord

hello,I got the same erro,my tf serving document is "/home/hufangjian2017/serving". I comment out "serving/tensorflow/tensorflow/contrib/image/__init__py" "#from tensorflow.contrib.image.python.ops.single_image_random_dot_stereograms import " what should i do next?

hufangjian avatar Jan 22 '18 12:01 hufangjian

anyone face the same error after you comment out the code. why I comment out the code #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 didn't work for me .

fennudehaogua avatar Jan 31 '18 03:01 fennudehaogua

@fennudehaogua try an earlier version e.g. r1.4:

git clone --recurse-submodules https://github.com/tensorflow/serving && \
    cd serving && \
    git checkout r1.4 && \
    cd tensorflow && \
    git checkout r1.4 && \
    ./configure

I think they are investigating why this is not working in the newer releases rn.

MtDersvan avatar Jan 31 '18 05:01 MtDersvan

@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!

fennudehaogua avatar Jan 31 '18 09:01 fennudehaogua

I am using bazel version 0.9.0 its not working for me either after commenting the line you mentioned above. For using bazel 0.8.1 do we have to repeat the whole build process again?

Anirudh1313 avatar Jan 31 '18 23:01 Anirudh1313