-
Notifications
You must be signed in to change notification settings - Fork 31
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
Conversation
@@ -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): |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
I have tested on tensorflow v1.8.0 and v1.9.0 and both works. |
modify some codes:
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