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

I trained a simple mnist model with tensorflow 2.0 on Google Colab and saved it in the .json format. 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’

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

In tf2.0 , the gfile package has been moved into tf.io. so u can use tf.io.gfile

I had the same error. It’s tensorflow 2.0 the new version.

Same here. Same issue still exists even with Tf2.2.0. The error comes while working with tokenization.FullTokenizer(vocab_file, do_lower_case) so we cant even go to the file and change it

Hi, I am still facing the same issue even after using tensorflow 2.2 and chaning the configuration as mentioned. Please look at image below. Screenshot from 2020-05-22 01-09-38

It may be the API change from TensorFlow 2.0.

We may change the usage of this API for this newer version.