Fix Some Code to compat for tf 2.0
Here are some existing bugs in the code when using tf2.0:
optimizer.py , line 87
tf.train.Optimizer => tf.compat.v1.train.Optimizer
run_classifier.py, line 29
flags = tf.flags => flags = tf.compat.v1.flags
last line tf.app.run() => tf.compat.v1.app.run()
FLAGS = flags.FLAGS dont work either!!!!!!!!!!!!!! please help !!!!
after i change the previous one, and i got " module 'tensorflow' has no attribute 'flags'"
I changed the code according to the first comment. But I still get AttributeError: type object 'Flag' has no attribute 'FLAGS' How to fix this? Thanks in advance.
the status probably could be tracked at https://github.com/google-research/bert/pull/1035