tensorflow: Error_Converting_TliteFormat

…## System information##… -Python -2.7.12 -OS -Ubuntu 16.04 -Tensorflow version-1.4.0 -Bazel version-0.8.0 …##Description ###…

  1. I went through the following link and =>https://codelabs.developers.google.com/codelabs/tensorflow-for-poets/#3 and successfully retrained the last layer of the model.

  2. Now i was trying to use that retrained.pb file and convert into.tlite format. =>https://github.com/tensorflow/tensorflow –Downloaded the tensorflow-master directory. –Install Bazel (0.8.0) –Then, using the retrained.pb file,trying to do model format conversion –Downloaded the checkpoints from =>https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet_v1.md But got stucked while running the command for conversion.[bazel-bin/tensorflow/python/tools/freeze_graph --input_graph=/home/ee210201/tensorflow-for-poets-2/tf_files/retrained_graph.pb --input_checkpoint=/tmp/checkpoints/mobilenet_v1_0.50_224.ckpt.data-00000-of-00001 --input_binary=true --output_graph=/tmp/checkpoints/frozen_mobilenet.pb --output_node_names=Softmax}

…### Source code ##… 1. (tensorflow) root@pcz-ee210201:/u/tensorflow-master# bazel build -c opt --copt=-msse4.1 --copt=-msse4.2 tensorflow/python/tools:freeze_graph

=>INFO: Elapsed time: 1057.269s, Critical Path: 44.92s INFO: Build completed successfully, 2109 total actions …

  1. But while running the below script [To convert into .tlite format] ,i was unable to resolved the following error? (tensorflow) root@pcz-ee210201:/u/tensorflow-master# bazel-bin/tensorflow/python/tools/freeze_graph --input_graph=/home/ee210201/tensorflow-for-poets-2/tf_files/retrained_graph.pb --input_checkpoint=/tmp/checkpoints/mobilenet_v1_0.50_224.ckpt.data-00000-of-00001 --input_binary=true --output_graph=/tmp/checkpoints/frozen_mobilenet.pb --output_node_names=Softmax

Error:::::::::::::::::::::::::::::::::::::::::

Traceback (most recent call last):
  File "/u/tensorflow-master/bazel-bin/tensorflow/python/tools/freeze_graph.runfiles/org_tensorflow/tensorflow/python/tools/freeze_graph.py", line 56, in <module>
    from tensorflow.python.tools import saved_model_utils
  File "/u/tensorflow-master/bazel-bin/tensorflow/python/tools/freeze_graph.runfiles/org_tensorflow/tensorflow/python/tools/saved_model_utils.py", line 21, in <module>
    from tensorflow.contrib.saved_model.python.saved_model import reader
  File "/u/tensorflow-master/bazel-bin/tensorflow/python/tools/freeze_graph.runfiles/org_tensorflow/tensorflow/contrib/__init__.py", line 82, in <module>
    from tensorflow.contrib.eager.python import tfe as eager
  File "/u/tensorflow-master/bazel-bin/tensorflow/python/tools/freeze_graph.runfiles/org_tensorflow/tensorflow/contrib/eager/python/tfe.py", line 75, in <module>
    from tensorflow.contrib.eager.python.datasets import Iterator
  File "/u/tensorflow-master/bazel-bin/tensorflow/python/tools/freeze_graph.runfiles/org_tensorflow/tensorflow/contrib/eager/python/datasets.py", line 23, in <module>
    from tensorflow.contrib.data.python.ops import prefetching_ops
  File "/u/tensorflow-master/bazel-bin/tensorflow/python/tools/freeze_graph.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 "/u/tensorflow-master/bazel-bin/tensorflow/python/tools/freeze_graph.runfiles/org_tensorflow/tensorflow/contrib/util/loader.py", line 55, in load_op_library
    ret = load_library.load_op_library(path)
  File "/u/tensorflow-master/bazel-bin/tensorflow/python/tools/freeze_graph.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 "/u/tensorflow-master/bazel-bin/tensorflow/python/tools/freeze_graph.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: /u/tensorflow-master/bazel-bin/tensorflow/python/tools/freeze_graph.runfiles/org_tensorflow/tensorflow/contrib/data/python/ops/../../_prefetching_ops.so: undefined symbol: _ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx11E
.........................................................................................................................

Please let me know what does above error –(tensorflow.python.framework.errors_impl.NotFoundError: --_ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx11E) means and how to solved it.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 33 (10 by maintainers)

Most upvoted comments

Please suggest me what should i try to resolved the issue.

I had this issue because I installed “libtensorflow_framework.so” in my system. Removing this library out of “/usr/local/lib” solved this problem for me.

About the link error of tensorflow/serving#684 , I fixed adding deps on BUILD file under “./tensorflow/tensorflow/contrib/data/” as below.

28 tf_custom_op_library( 29 name = “_prefetching_ops.so”, 30 srcs = [“ops/prefetching_ops.cc”], 31 deps = [ 32 “//tensorflow/contrib/data/kernels:prefetching_kernels”, 33 “@protobuf_archive//:protobuf”, 34 ], 35 )

But it makes core dump…

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-12-20 15:40:15.177713: 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: SSE4.1 SSE4.2 AVX AVX2 FMA 2017-12-20 15:40:15.584699: F external/org_tensorflow/tensorflow/core/framework/op.cc:54] Non-OK-status: RegisterAlreadyLocked(op_data_factory) status: Already exists: Op with name _Arg (core dumped)

I am unable to resolve the issue.

I have same problem. No updates?

Get the same error running a query client

root@ubuntu:~/tools/tensorflow-serving$ bazel-bin/tensorflow_serving/example/inception_client --server=localhost:9000 --image=/root/data/flower_photos/roses/5529341024_0c35f2657d.jpg Traceback (most recent call last): File "/root/tools/tensorflow-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 "/root/tools/tensorflow-serving/bazel-bin/tensorflow_serving/example/inception_client.runfiles/org_tensorflow/tensorflow/python/platform/app.py", line 124, in run _sys.exit(main(argv)) File "/root/tools/tensorflow-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 "/root/tools/tensorflow-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 "/root/tools/tensorflow-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/lib64/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/root/tools/tensorflow-serving/bazel-bin/tensorflow_serving/example/inception_client.runfiles/org_tensorflow/tensorflow/contrib/__init__.py", line 82, in <module> from tensorflow.contrib.eager.python import tfe as eager File "/root/tools/tensorflow-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 "/root/tools/tensorflow-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 "/root/tools/tensorflow-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 "/root/tools/tensorflow-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 "/root/tools/tensorflow-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 "/root/tools/tensorflow-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: /root/tools/tensorflow-serving/bazel-bin/tensorflow_serving/example/inception_client.runfiles/org_tensorflow/tensorflow/contrib/data/python/ops/../../_prefetching_ops.so: undefined symbol: _ZN6google8protobuf8internal26fixed_address_empty_stringE

We started seeing the same error in TensorFlow Serving at around the same time when running an example client - https://github.com/tensorflow/serving/issues/684

tensorflow.python.framework.errors_impl.NotFoundError: /tensorflow/bazel-bin/tensorflow/examples/image_retraining/retrain.runfiles/org_tensorflow/tensorflow/contrib/data/python/ops/../../_prefetching_ops.so: undefined symbol: _ZN6google8protobuf8internal26fixed_address_empty_stringB5cxx11E

Any ideas?