bert icon indicating copy to clipboard operation
bert copied to clipboard

Fix gfile and flags no attribute error for TensorFlow V2

Open CryptoSalamander opened this issue 4 years ago • 0 comments

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.

CryptoSalamander avatar Aug 02 '21 07:08 CryptoSalamander