Error in project

Help me with is error please

Hello, and welcome!

It looks like there are some red squiggles in the grey blob :slight_smile:

More seriously, it’s hard to help from a screenshot: in the default view, “red squiggles” really is all I can see, and the expanded view won’t help someone with vision impairment. Screenshots also make it impossible to tell if there are exotic or unseen Unicode characters causing problems (probably not in this case, but I can’t actually tell that :wink: ), and it also prevents someone from copying your code to try to reproduce the issue themselves; instead, they would have to transcribe the code from the image and possibly introduce their own bugs in the process.

To better enable people to help you, please copy the text of the error here into a preformatted block (use the button in the formatting toolbar that looks like </>), and also copy only as much code as is necessary to reproduce the error. It’s also possible that the process of reducing the code to just what produces the error will show you the cause and allow you to fix it on your own.


Your error screenshot is really hard for me to read, and of course it is impossible for us to copy the text since we don’t use Photoshop to write our code.

If future, please copy and paste the error message as text, formatting it as code using the </> code block tool in the fancy editor, or using three backticks as code fences in the markdown text editor:

paste your full error message here

As far as I can tell, the error is:

# Retyping, not copying, so please forgive any typos
AttributeError: module tensorflow has no attribute gfile

I’m not an expert on tensorflow, but that seems to be expected. Looking at the documentation for tensorflow, I see no “gfile”:

and googling for “tf.gfile” comes up with one stackoverflow thread:

but clicking through to the official documentation gives a 404 page not found error, so my guess is that tf.gfile is no longer supported by tensorflow.

There is a, but it doesn’t seem to have a read method.

There is also a function.

So my guess is that tf.gfile maybe used to work, in tensorflow version 1, but you are now using version 2, and it no longer works. I don’t know how to fix it.

Maybe somebody else can suggest a fix.