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

support tf version 1.8.0 #6

Merged
merged 1 commit into from
Jul 27, 2018
Merged

support tf version 1.8.0 #6

merged 1 commit into from
Jul 27, 2018

Conversation

kaierlong
Copy link
Contributor

modify some codes:

  1. _Linear function
  2. init of BitGRUCell and BitLSTMCell
  3. default value of reuse in tf.variable_scope

test platform: Ubuntu 16.04.5 x86_64 GPU
test version: 1.8.0

test platfrom: macOS 10.13.6 x86_64 CPU
test version: 1.9.0

@qinyao-he qinyao-he self-requested a review July 27, 2018 06:13
@@ -62,7 +62,7 @@ def main(_):

with tf.Graph().as_default(), tf.Session() as session:
initializer = tf.initializers.variance_scaling(distribution='uniform')
with tf.variable_scope("model", reuse=None, initializer=initializer):
with tf.variable_scope("model", reuse=tf.AUTO_REUSE, initializer=initializer):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we should add AUTO_REUSE here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AUTO_REUSE can decide whether or not to reuse the weights in one model by tensorflow automatically, especially when there are rnn cells. Also we can set the value of reuse by hand, but the AUTO_REUSE may be more simple.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously I don't have this issue. The weight of the same name must be created twice after this upgrade. I will check what cause this change later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qinyao-he you mean after use AUTO_REUSE only or the whole upgrade?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this upgrade to tf1.8, I find it must add AUTO_REUSE to run. But previously there is no need.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qinyao-he This may be caused by the change of tensorflow's api. Some of my own projects met the problem too. So I use AUTO_REUSE for simplicity.

@qinyao-he
Copy link
Owner

I have tested on tensorflow v1.8.0 and v1.9.0 and both works.
Thanks @kaierlong

@qinyao-he qinyao-he merged commit 512b6bd into qinyao-he:master Jul 27, 2018
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.

2 participants