Tensorflow: Tensorflow not assigning any tasks to GPU in cifar10 example

Created on 20 Nov 2015  ·  3Comments  ·  Source: tensorflow/tensorflow

I'm running the cifar10_multi_gpu_train.py script with the device placement logging turned on, and I see that all of the operations are being placed on the CPU. When I run it, it outputs:

Filling queue with 20000 CIFAR images before starting to train. This will take a few minutes.
I tensorflow/core/common_runtime/local_device.cc:25] Local device intra op parallelism threads: 8
I tensorflow/core/common_runtime/direct_session.cc:45] Direct session inter op parallelism threads: 8
Device mapping: no known devices.
I tensorflow/core/common_runtime/direct_session.cc:111] Device mapping:

softmax_linear/biases/ExponentialMovingAverage: /job:localhost/replica:0/task:0/cpu:0
I tensorflow/core/common_runtime/simple_placer.cc:289] softmax_linear/biases/ExponentialMovingAverage: /job:localhost/replica:0/task:0/cpu:0
.....
.....

I would imagine that the line Device mapping: no known devices. is supposed to list the devices associated with the current Session, but why does it not have any devices? The script calls
tf.device('/gpu:0').

My GPU is Nvidia GeForce GTX 970.

Most helpful comment

Solved this.

I must have accidentally built the python package without the "--config=cuda" flag. When I rebuilt with this flag, then pip uninstalled tensorflow, then reinstalled with the newly built package, it worked perfectly.

All 3 comments

Solved this.

I must have accidentally built the python package without the "--config=cuda" flag. When I rebuilt with this flag, then pip uninstalled tensorflow, then reinstalled with the newly built package, it worked perfectly.

The same problem occurred when I was running the cifar10_multi_gpu_train.py script with the device placement logging turned on. I have no idea what do you mean when you say "I must have accidentally built the python package without the "--config=cuda" flag", can you tell which python package you rebuilt?

@GuangmingZhu , on the TensorFlow Download and Setup page, the command to build the pip package should be:

bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

I just forgot the --config=cuda.

Was this page helpful?
0 / 5 - 0 ratings