serving: Not found error when trying to run model

Trying bazel build -c opt tensorflow_serving/… doesn’t work so, it always gives me a SIMD not enabled (maybe define GEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK in the source code when x86_64) error, so I had to use bazel build -c opt --copt=-msse4.1 --copt=-msse4.2 tensorflow_serving/… and that built wihtout any errors. But now I always get the same error when trying to test the running model, in fact I get the error trying to run anything in the container. I had to export the model myself by adding savedmodelbuilder code into the retrain script for inception. I’m on an Ubunutu PC, but I tried running tensorflow serving on a mac pro and got the same error when trying bazel build -c opt tensorflow_serving/… so again I had to use bazel build -c opt --copt=-msse4.1 --copt=-msse4.2 tensorflow_serving/…, and again the same exact error listed below

root@42fd2c27af9d:/serving# bazel-bin/tensorflow_serving/example/inception_client --server=localhost:9000 --image=./Xiang_Xiang_panda.jpg
Traceback (most recent call last):
  File "/serving/bazel-bin/tensorflow_serving/example/inception_client.runfiles/tf_serving/tensorflow_serving/example/inception_client.py", line 56, in <module>
    tf.app.run()
  File "/serving/bazel-bin/tensorflow_serving/example/inception_client.runfiles/org_tensorflow/tensorflow/python/platform/app.py", line 129, in run
    _sys.exit(main(argv))
  File "/serving/bazel-bin/tensorflow_serving/example/inception_client.runfiles/tf_serving/tensorflow_serving/example/inception_client.py", line 50, in main
    tf.contrib.util.make_tensor_proto(data, shape=[1]))
  File "/serving/bazel-bin/tensorflow_serving/example/inception_client.runfiles/org_tensorflow/tensorflow/python/util/lazy_loader.py", line 53, in __getattr__
    module = self._load()
  File "/serving/bazel-bin/tensorflow_serving/example/inception_client.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 "/serving/bazel-bin/tensorflow_serving/example/inception_client.runfiles/org_tensorflow/tensorflow/contrib/__init__.py", line 81, in <module>
    from tensorflow.contrib.eager.python import tfe as eager
  File "/serving/bazel-bin/tensorflow_serving/example/inception_client.runfiles/org_tensorflow/tensorflow/contrib/eager/python/tfe.py", line 75, in <module>
    from tensorflow.contrib.eager.python.datasets import Iterator
  File "/serving/bazel-bin/tensorflow_serving/example/inception_client.runfiles/org_tensorflow/tensorflow/contrib/eager/python/datasets.py", line 23, in <module>
    from tensorflow.contrib.data.python.ops import prefetching_ops
  File "/serving/bazel-bin/tensorflow_serving/example/inception_client.runfiles/org_tensorflow/tensorflow/contrib/data/python/ops/prefetching_ops.py", line 25, in <module>
    resource_loader.get_path_to_datafile("../../_prefetching_ops.so"))
  File "/serving/bazel-bin/tensorflow_serving/example/inception_client.runfiles/org_tensorflow/tensorflow/contrib/util/loader.py", line 55, in load_op_library
    ret = load_library.load_op_library(path)
  File "/serving/bazel-bin/tensorflow_serving/example/inception_client.runfiles/org_tensorflow/tensorflow/python/framework/load_library.py", line 56, in load_op_library
    lib_handle = py_tf.TF_LoadLibrary(library_filename, status)
  File "/serving/bazel-bin/tensorflow_serving/example/inception_client.runfiles/org_tensorflow/tensorflow/python/framework/errors_impl.py", line 473, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: /serving/bazel-bin/tensorflow_serving/example/inception_client.runfiles/org_tensorflow/tensorflow/contrib/data/python/ops/../../_prefetching_ops.so: undefined symbol: _ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx11E

When I check the running log I can see that my model is running:


2017-12-09 01:24:00.397485: I tensorflow_serving/model_servers/main.cc:147] Building single TensorFlow model file config:  model_name: inception model_base_path: /tmp/new5
2017-12-09 01:24:00.397670: I tensorflow_serving/model_servers/server_core.cc:439] Adding/updating models.
2017-12-09 01:24:00.397696: I tensorflow_serving/model_servers/server_core.cc:490]  (Re-)adding model: inception
2017-12-09 01:24:00.498119: I tensorflow_serving/core/basic_manager.cc:705] Successfully reserved resources to load servable {name: inception version: 1}
2017-12-09 01:24:00.498154: I tensorflow_serving/core/loader_harness.cc:66] Approving load for servable version {name: inception version: 1}
2017-12-09 01:24:00.498169: I tensorflow_serving/core/loader_harness.cc:74] Loading servable version {name: inception version: 1}
2017-12-09 01:24:00.498189: I external/org_tensorflow/tensorflow/contrib/session_bundle/bundle_shim.cc:360] Attempting to load native SavedModelBundle in bundle-shim from: /tmp/new5/1
2017-12-09 01:24:00.498203: I external/org_tensorflow/tensorflow/cc/saved_model/loader.cc:236] Loading SavedModel from: /tmp/new5/1
2017-12-09 01:24:00.623487: I external/org_tensorflow/tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2 FMA
2017-12-09 01:24:00.743901: I external/org_tensorflow/tensorflow/cc/saved_model/loader.cc:155] Restoring SavedModel bundle.
2017-12-09 01:24:00.798587: I external/org_tensorflow/tensorflow/cc/saved_model/loader.cc:190] Running LegacyInitOp on SavedModel bundle.
2017-12-09 01:24:00.805405: I external/org_tensorflow/tensorflow/cc/saved_model/loader.cc:284] Loading SavedModel: success. Took 307196 microseconds.
2017-12-09 01:24:00.805517: I tensorflow_serving/core/loader_harness.cc:86] Successfully loaded servable version {name: inception version: 1}
2017-12-09 01:24:00.810840: I tensorflow_serving/model_servers/main.cc:288] Running ModelServer at 0.0.0.0:9000 ...

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 9
  • Comments: 52 (4 by maintainers)

Commits related to this issue

Most upvoted comments

I get the same error when I try to run bazel-bin/tensorflow_serving/example/inception_saved_model /tmp/inception_model.

Ubuntu16.04 CPU

I get the same error when I try to run mnist_saved_model by bazel. But It’s ok when I run it by python.

I am also seeing the error described by @jda91

No resolution to this after over two months?

Maybe someone should git bisect to find the exact commit causing the problem. Too bad compiling takes so long.

+1. I get the same error when I try to run mnist_saved_model.

Seeing the same issue on 21st may with r1.6 while trying to run it inside the docker container built with the image provided in the tensorflow-serving tutorial with Kubernetes. Is there any official workaround/solution for this other than using r1.4 or manually editing the workspace file?

Build label: 0.9.0 TF: 1.5.0 CPU Python 2.7.14 :: Anaconda custom (64-bit) Ubuntu 16.04 TLS

The same error arise when I try to run inception-client using bazel and inception-sever using both bazel and tensorflow-serving-api.

bazel built

bazel-bin/tensorflow_serving/model_servers/tensorflow_model_server --port=9000 --model_name=inception --model_base_path=inception-export

bazel-bin/tensorflow_serving/example/inception_client --server=localhost:9000 --image=/path-to-image

tensorflow-serving-apis

tensorflow_model_server --port=9000 --model_name=inception --model_base_path=inception-export

bazel-bin/tensorflow_serving/example/inception_client--server=localhost:9000 --image=/path-to-image

The error is the same as above mentioned

File “/home/zyb/serving/bazel-bin/tensorflow_serving/example/inception_client.runfiles/org_tensorflow/tensorflow/python/framework/errors_impl.py”, line 473, in exit c_api.TF_GetCode(self.status.status)) tensorflow.python.framework.errors_impl.NotFoundError: /home/zyb/serving/bazel-bin/tensorflow_serving/example/inception_client.runfiles/org_tensorflow/tensorflow/contrib/data/python/ops/…/…/_prefetching_ops.so: undefined symbol: _ZN6google8protobuf8internal9ArenaImpl10AddCleanupEPvPFvS3_E


But it workes well when inception-client in python and inception-sever in bazel

bazel-bin/tensorflow_serving/model_servers/tensorflow_model_server --port=9000 --model_name=inception --model_base_path=inception-export

python tensorflow_serving/example/inception_client.py --server=localhost:9000 --image=/path-to-image

Any solutions? Thanks in advance.

I think the issue is caused by commit https://github.com/tensorflow/tensorflow/commit/cd81bc8e09c7f551911276c5bfaafa6930f1961f, which is later fixed by https://github.com/tensorflow/tensorflow/commit/36ec749ec79c2313924666a1c5324620e493d0c4. This fix is not available in the Tensorflow that Tensorflow Serving master branch is referencing.

One workaround is to manually update the git commit hash in Tensorflow Serving Workspace file to reference a version of Tensorflow that has this issue fixed. That works for me locally at least (note you can just disable the sha256 if you don’t want to generate one), and I can export the Inception model now. As a reference the commit has I am using is the head of r1.8 as of today (3970b47da568a783818f43ec9f8df5acf692fe7c).

@charmoniumQ I got r1.4 working. I believe this is what worked for me:

git clone -b r1.4 --recurse-submodules https://github.com/tensorflow/serving
cd serving/tensorflow
./configure
cd ..
bazel build

Rather than cloning from master branch clone from ‘r1.4’ it works then