Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR to resolve issue #1140 - AttributeError: module 'tensorflow._api.v2.train' has no attribute 'Optimizer' #1155

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

abhilash1910
Copy link

This PR has a minor modification to remove the error due to tensorflow version (>=2) incompatibility for optimizer.py.
Due to deprecation of 'tf.train.Optimizer', an improvement is made which allows the optimizer to run smoothly with tf version>=2(tested locally with 2.3.1) .
Suggestions are appreciated.Thanks

@abhilash1910
Copy link
Author

Changes:

  1. Provided python 2 support for _run_split_on_punc (tokenization.py)
  2. Provided tf2 options in modeling.py and modeling_test.py

@chetaspahuja
Copy link

:shipit:

@ghost
Copy link

ghost commented Jul 18, 2024

Changes:

1. Provided python 2 support for _run_split_on_punc  (tokenization.py)

2. Provided tf2  options in modeling.py and modeling_test.py


@abhilash1910 , for tensorflow 2.16.x, python throws an error message when modeling.BertModel() gets called.

AttributeError: Tensor.name is undefined when eager execution is enabled.

Essentially, the issue is with name = tensor.name on line 911 in modeling.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants