bert
bert copied to clipboard
module 'tensorflow' has no attribute 'flags'
how to fix it?
install tensorflow 1.14
install tensorflow 1.14
solved my problem, thank you
i want to use TF 2.x How to fix it
I followed the fix in https://github.com/google-research/bert/pull/1247 and v2.10.0 works fine now.
if(tf.__version__.startswith("2")):
# tf.gfile = tf.io.gfile
tf.gfile = tf.compat.v1.gfile
tf.flags = tf.compat.v1.flags
tf.app = tf.compat.v1.app
tf.logging = tf.compat.v1.logging
tf.python_io = tf.compat.v1.python_io