aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/examples/tutorials/mnist
diff options
context:
space:
mode:
authorGravatar Illia Polosukhin <ipolosukhin@google.com>2016-11-03 14:46:06 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-11-03 16:09:01 -0700
commitcbd3cacfb73bbea912b9d01c2540187684f751a7 (patch)
treec2c22af2d05583491b1370dcabdb2e83cb61e2ee /tensorflow/examples/tutorials/mnist
parent703fce57eaae725c4ae4b0bd23629c4f04a9de16 (diff)
Replace usages initialize_all_variables -> global_variables_initializer
Change: 138128703
Diffstat (limited to 'tensorflow/examples/tutorials/mnist')
-rw-r--r--tensorflow/examples/tutorials/mnist/fully_connected_feed.py2
-rw-r--r--tensorflow/examples/tutorials/mnist/mnist_softmax.py2
-rw-r--r--tensorflow/examples/tutorials/mnist/mnist_with_summaries.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/tensorflow/examples/tutorials/mnist/fully_connected_feed.py b/tensorflow/examples/tutorials/mnist/fully_connected_feed.py
index 7e4d408110..f0b4711487 100644
--- a/tensorflow/examples/tutorials/mnist/fully_connected_feed.py
+++ b/tensorflow/examples/tutorials/mnist/fully_connected_feed.py
@@ -143,7 +143,7 @@ def run_training():
summary = tf.summary.merge_all()
# Add the variable initializer Op.
- init = tf.initialize_all_variables()
+ init = tf.global_variables_initializer()
# Create a saver for writing training checkpoints.
saver = tf.train.Saver(write_version=tf.train.SaverDef.V2)
diff --git a/tensorflow/examples/tutorials/mnist/mnist_softmax.py b/tensorflow/examples/tutorials/mnist/mnist_softmax.py
index beb184f775..9d00c0f9af 100644
--- a/tensorflow/examples/tutorials/mnist/mnist_softmax.py
+++ b/tensorflow/examples/tutorials/mnist/mnist_softmax.py
@@ -59,7 +59,7 @@ def main(_):
sess = tf.InteractiveSession()
# Train
- tf.initialize_all_variables().run()
+ tf.global_variables_initializer().run()
for _ in range(1000):
batch_xs, batch_ys = mnist.train.next_batch(100)
sess.run(train_step, feed_dict={x: batch_xs, y_: batch_ys})
diff --git a/tensorflow/examples/tutorials/mnist/mnist_with_summaries.py b/tensorflow/examples/tutorials/mnist/mnist_with_summaries.py
index fc91ac4ddd..0e12a6571b 100644
--- a/tensorflow/examples/tutorials/mnist/mnist_with_summaries.py
+++ b/tensorflow/examples/tutorials/mnist/mnist_with_summaries.py
@@ -140,7 +140,7 @@ def train():
train_writer = tf.train.SummaryWriter(FLAGS.log_dir + '/train',
sess.graph)
test_writer = tf.train.SummaryWriter(FLAGS.log_dir + '/test')
- tf.initialize_all_variables().run()
+ tf.global_variables_initializer().run()
# Train the model, and also write summaries.
# Every 10th step, measure test-set accuracy, and write test summaries