question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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’

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

15reactions
AlbertBJcommented, Jun 17, 2019

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

2reactions
anyaozmcommented, Apr 20, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

module 'tensorflow' has no attribute 'gfile' - Version 2.0.0- ...
Tensorflow Version - 2.0.0-alpha0 Error occurred while running a notebook ... AttributeError: module 'tensorflow' has no attribute 'gfile' ...
Read more >
AttributeError: module 'tensorflow' has no attribute 'gfile'
GFile(path, 'r') as fid: AttributeError: module 'tensorflow' has no attribute 'gfile'. 1.Find label_map_util.py line 137. 2.Replace tf.gfile ...
Read more >
module 'tensorflow' has no attribute 'gfile' - TensorRT
Container is tensorflow 2.x and python 3.8 so unable to run sample with the version mismatches. attributeerror: module 'tensorflow' has no ...
Read more >
AttributeError: module 'tensorflow' has no attribute 'gfile'
AttributeError : module 'tensorflow' has no attribute 'gfile'. i am using tensor flow version 2.0.0 and i know in tensor flow 2.0 the...
Read more >
module 'tensorflow' has no attribute 'gfile'. Did you mean: 'fill'?
AttributeError : module 'tensorflow' has no attribute 'gfile'. Did you mean: 'fill'? replace tf.gfile >> tf.io.gfile :)
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found