-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Maybe wrong when computing batch_normalization? #7
Comments
Hi, By returning same variables, do you mean same value? or is it another issue? If you are using that operation without TFLearn trainer class, you need to specify a training mode:
(There is little typo in the doc hat can be confusing; this operation actually 'set' the training mode, and not 'check' it. I will update it) |
Hi,
|
tf.control_dependencies is an operation used to ensure that |
Hi, |
|
I find a example code use the very similar code in tensorflow/tensorflow#1724 as in batch_normalization: x = tf.Variable(1.) do_update = tf.placeholder(tf.bool) ema = tf.train.ExponentialMovingAverage(.9) avg_without_update = ema.average(x) with tf.control_dependencies([ema_assign]): avg = tf.python.control_flow_ops.cond(do_update, lambda: avg_with_update, lambda: avg_without_update) with tf.Session() as sess: here do_update is false, but the average is updated, could you tell me where goes wrong? |
It seems there is a bug here. Referring to the issue you sent, it seems that conditions (fn1 & fn2) dependencies are always executed, no matter the condition of tf.cond(), thus the result... I can try to see if there is a workaround, or wait for TensorFlow to patch it. |
Hi,
in function batch_normalization, there has a line which update the mean and var or not according to in training or evaluating mode, but seems like both return the same variables.
... mean, var = tf.python.control_flow_ops.cond( is_training, update_mean_var, lambda: (ema_mean, ema_var)) ...
The text was updated successfully, but these errors were encountered: