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.
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
I got the same error on the official Docker on macOS
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.
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.
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?
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 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!
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.
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!
Same issue here.
:+1:
Any news?
Same issue here. I've installed tensorflow from source: CPU version with XLA enabled.
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)
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?
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 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 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!
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?