aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/examples/how_tos/reading_data/fully_connected_preloaded.py
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/examples/how_tos/reading_data/fully_connected_preloaded.py')
-rw-r--r--tensorflow/examples/how_tos/reading_data/fully_connected_preloaded.py7
1 files changed, 4 insertions, 3 deletions
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)