I am trying to use the latest batch_norm() and found it here: batch_norm. If I use help(tf.contrib.layers.batch_norm)
from IPython, I see the following docstring of interest:
Note: When is_training is True the moving_mean and moving_variance need to be updated, by default the update_ops are placed in
tf.GraphKeys.UPDATE_OPS
so they need to be added as a dependency to thetrain_op
, example:
update_ops = tf.get_collection(tf.GraphKeys.UPDATE_OPS)
if update_ops:
updates = tf.group(*update_ops)
total_loss = control_flow_ops.with_dependencies([updates], total_loss)
However the source code at batch_norm has the following docstring which has been corrected.
Note: When is_training is True the moving_mean and moving_variance need to be updated, by default the update_ops are placed in
tf.GraphKeys.UPDATE_OPS
so they need to be added as a dependency to thetrain_op
, example:
update_ops = tf.get_collection(tf.GraphKeys.UPDATE_OPS)
with tf.control_dependencies(update_ops):
train_op = optimizer.minimize(loss)
Using tf.__version__
from IPython prompt, I get '0.12.1'. How can I tell if the code I am running is the same as the latest in tf.contrib.layers? If only the docstring changed and the code is the same, I would rather not upgrade or reinstall tensorflow as I have everything working well with GPU. My install is inside of a mini conda environment and tensorflow was originally installed with pip from inside this environment. Also, if I do need a different version, what is the best way to get it and then test that I have the matching version from tf.contrib.layers?