From ebe109b76d3a8fbdfadee8fa1e6e642563c88034 Mon Sep 17 00:00:00 2001 From: Yaroslav Bulatov Date: Fri, 22 Jan 2016 16:21:34 -0800 Subject: Pin constant holding data to CPU. This makes GPU version 50-100x faster per step. Fixes #837 Change: 112829709 --- .../examples/how_tos/reading_data/fully_connected_preloaded.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tensorflow/examples/how_tos') diff --git a/tensorflow/examples/how_tos/reading_data/fully_connected_preloaded.py b/tensorflow/examples/how_tos/reading_data/fully_connected_preloaded.py index 39ce1a759b..93ab4dfdf8 100644 --- a/tensorflow/examples/how_tos/reading_data/fully_connected_preloaded.py +++ b/tensorflow/examples/how_tos/reading_data/fully_connected_preloaded.py @@ -65,9 +65,10 @@ def run_training(): # Tell TensorFlow that the model will be built into the default Graph. with tf.Graph().as_default(): with tf.name_scope('input'): - # Input data - input_images = tf.constant(data_sets.train.images) - input_labels = tf.constant(data_sets.train.labels) + # Input data, pin to CPU because rest of pipeline is CPU-only + with tf.device('/cpu:0'): + input_images = tf.constant(data_sets.train.images) + input_labels = tf.constant(data_sets.train.labels) image, label = tf.train.slice_input_producer( [input_images, input_labels], num_epochs=FLAGS.num_epochs) -- cgit v1.2.3