Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gfile and flags no attribute error for TensorFlow V2 #1247

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CryptoSalamander
Copy link

There are "no attribute" errors such as
AttributeError: module 'tensorflow' has no attribute 'gfile'
AttributeError: module 'tensorflow' has no attribute 'flags'

because tensorflow V2 is automatically installed from pip install -r requirements.txt.

To fix this error, I added version check code and make it works properly in TensorFlow V2 environments.

Also, TensorFlow V1 users can use this code. because if tf.version is lower than 2.0.0, it will use legacy code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant