为什么我会收到Tensorflow服务模块导入错误?

阿尔宾

我正在尝试使用TensorFlow服务。我按照这些说明安装了TensorFlow

当我尝试在我的python代码中使用此行时

from tensorflow_serving.session_bundle import exporter

我有这个问题

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

为什么会出现这个问题?我是否缺少构建TensorFlow来包含此模块的内容?

PS:Hello World TensorFlow应用程序在我的设置中运行正常。

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

花了无数小时之后,我设法找到了解决方案。

当我换线时

from tensorflow_serving.session_bundle import exporter

from tensorflow.contrib.session_bundle import exporter

似乎TF开发人员决定更改其在源树中的session_bundle包位置。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章