Error explicit requirement for tensor flow tester

I am trying to run a CIFAR10 tutorial with learning code on one gpu and eval code on another. I know for sure that I have two gpus on my computer, and I can verify this by following simple examples here: https://www.tensorflow.org/how_tos/using_gpu/index.html

However, using the with device('/gpu:0') parameter with device('/gpu:0') does not work for most variables in the CIFAR example. I tried many combinations of different variables on gpu vs. cpu or all variables on one or the other. Always the same error for some variable, something like this:

 Cannot assign a device to node 'shuffle_batch/random_shuffle_queue': Could not satisfy explicit device specification '/gpu:0' 

Perhaps this is a mistake in Tensor Flow, or am I missing something?

+7
python tensorflow tensorflow-gpu
source share
1 answer

Could not satisfy explicit device specification means that you do not have a corresponding device. Do you actually have a CUDA-enabled GPU?

UPDATE: As it turned out in the discussion below, this error also occurs if a specific operation (in this case RandomShuffleQueue ) cannot be performed on the GPU, since it only has a CPU implementation.

If everything is okay with choosing a TensorFlow device for you (in particular, returning to the CPU when there is no GPU implementation), consider setting allow_soft_placement in your configuration, as in this article :

 sess = tf.Session(config=tf.ConfigProto( allow_soft_placement=True, log_device_placement=True)) 
+8
source share

All Articles