bert icon indicating copy to clipboard operation
bert copied to clipboard

module 'tensorflow' has no attribute 'flags'

Open katysei opened this issue 4 years ago • 4 comments

how to fix it?

katysei avatar Oct 11 '20 08:10 katysei

install tensorflow 1.14

zhiyongLiu1114 avatar Dec 29 '20 03:12 zhiyongLiu1114

install tensorflow 1.14

solved my problem, thank you

chansonzhang avatar Jul 04 '21 03:07 chansonzhang

i want to use TF 2.x How to fix it

mHacks2021 avatar Feb 16 '22 11:02 mHacks2021

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

caop-kie avatar Oct 21 '22 19:10 caop-kie