google-research / bert

TensorFlow code and pre-trained models for BERT
https://arxiv.org/abs/1810.04805
Apache License 2.0
38.25k stars 9.62k forks source link

update/optimization_and_modeling->[update] optimzation.py and modeling.py for tensorflow 2x. #1414

Closed ghost closed 1 month ago

ghost commented 4 months ago

MOTIVATION

PR to resolve AttributeError: module 'tensorflow._api.v2.train' has no attribute 'Optimizer'

optimization.py:

modeling.py: (due to changes made in optimization.py)


CONFIGURATION

Reported-by : Майкл Шодеке Signed-off-by: Майкл Шодеке