Is Bert not compatible with tensorflow 2.0 ?
AttributeError Traceback (most recent call last)
1 import modeling
----> 2 import optimization
3 import run_classifier
4 import run_classifier_with_tfhub
5 import tokenization
/content/bert_repo/optimization.py in
85
86
---> 87 class AdamWeightDecayOptimizer(tf.train.Optimizer):
88 """A basic Adam optimizer that includes "correct" L2 weight decay."""
89
AttributeError: module 'tensorflow._api.v2.train' has no attribute 'Optimizer'
If you need TF 2.0 support, there are different Keras implementation out there - you could check mine at kpe/bert-for-tf2. (check this comment to #584 for additional info)
Work in progress but not fully ready: https://github.com/tensorflow/models/tree/master/official/bert
Work in progress but not fully ready: https://github.com/tensorflow/models/tree/master/official/bert
Thanks!
Can someone please explain to me in simple terms what do I need to include in the code to avoid getting this error : "AttributeError: module 'tensorflow._api.v2.train' has no attribute 'Optimizer' " ?
Most helpful comment
Work in progress but not fully ready: https://github.com/tensorflow/models/tree/master/official/bert