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

has no attribute 'stop_if_no_increase_hook' for tensorflow 1.9 #62

Open
kbwzy opened this issue Nov 8, 2019 · 1 comment
Open

has no attribute 'stop_if_no_increase_hook' for tensorflow 1.9 #62

kbwzy opened this issue Nov 8, 2019 · 1 comment

Comments

@kbwzy
Copy link

kbwzy commented Nov 8, 2019

Traceback (most recent call last):
File "main.py", line 171, in
hook = tf.contrib.estimator.stop_if_no_increase_hook(
AttributeError: module 'tensorflow.contrib.estimator' has no attribute 'stop_if_no_increase_hook'

@ivsanro1
Copy link

ivsanro1 commented Nov 18, 2019

You have to change the call tf.contrib.estimator.stop_if_no_increase_hook to tf.estimator.experimental.stop_if_no_increase_hook.

For example, in /models/lstm_crf/main.py, im the line 171, change:

hook = tf.contrib.estimator.stop_if_no_increase_hook(
            estimator, 'f1', 500, min_steps=8000, run_every_secs=120)

to:

hook = tf.estimator.experimental.stop_if_no_increase_hook(
            estimator, 'f1', 500, min_steps=8000, run_every_secs=120)

This worked for me for tensorflow==1.15.0

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

No branches or pull requests

2 participants