albin
albin

Reputation: 783

Why am I getting Tensorflow Serving module import error?

I am trying to use TensorFlow Serving. I installed TensorFlow serving with these instructions.

When I attempted use this line in my python code

from tensorflow_serving.session_bundle import exporter

I got this problem

>>> from tensorflow_serving.session_bundle import exporter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named tensorflow_serving.session_bundle

Why am I getting this problem? Am I missing something to build TensorFlow to include this module?

P.S.: Hello World TensorFlow application is working fine in my setup.

>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))

Upvotes: 3

Views: 2831

Answers (1)

albin
albin

Reputation: 783

After spending countless hours, I managed to find the solution.

When I changed the line

from tensorflow_serving.session_bundle import exporter

to

from tensorflow.contrib.session_bundle import exporter

It seems TF developers decided to change their session_bundle package location in the source tree.

Upvotes: 5

Related Questions