AttributeError: module 'tensorflow' has no attribute 'gfile'

笑着哭i 提交于 2019-12-23 03:33:15

问题


I trained a simple mnist model with tensorflow 2.0 on Google Colab and saved it in the .json format. Click here to check out the Colab Notebook where I've written the code. Then on running the command

!simple_tensorflow_serving --model_base_path="/" --model_platform="tensorflow"

It is showing the error AttributeError: module 'tensorflow' has no attribute 'gfile'

simple_tensorflow_serving helps in easily deploying trained tensorflow model into production.

Versions I'm using:

(1) TensorFlow - 2.0

(2) simple_tensorflow_serving - 0.6.4

Thank you in advance :)


回答1:


Simple Tensorflow Serving is not ready for Tensorflow 2.0, since it is using the old API. In Tensorflow 2.0 the gfile package has been moved into tf.io.

Then, you have to downgrade your Tensorflow instance to TF 1.13 use Simple Tensorflow Serving



来源:https://stackoverflow.com/questions/55591437/attributeerror-module-tensorflow-has-no-attribute-gfile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!