bert icon indicating copy to clipboard operation
bert copied to clipboard

Fix Some Code to compat for tf 2.0

Open choumartin1234 opened this issue 6 years ago • 4 comments

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()

choumartin1234 avatar Mar 06 '20 11:03 choumartin1234

FLAGS = flags.FLAGS dont work either!!!!!!!!!!!!!! please help !!!!

michaelearncoding avatar Mar 13 '20 12:03 michaelearncoding

after i change the previous one, and i got " module 'tensorflow' has no attribute 'flags'"

michaelearncoding avatar Mar 13 '20 12:03 michaelearncoding

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.

PlengNakdee avatar Mar 25 '20 09:03 PlengNakdee

the status probably could be tracked at https://github.com/google-research/bert/pull/1035

a-andreyev avatar Mar 26 '20 16:03 a-andreyev