So, I'm getting the following error :
" Cannot assign a device for operation 'Bincount_1': Could not satisfy explicit device specification '/device:GPU:0' because no supported kernel for GPU devices is available. [[Node: Bincount_1 = Bincount[T=DT_INT32, _device="/device:GPU:0"](ToInt32_1, Minimum_1, Const_7)]] "
And to me, this is very weird. Because I'm trying to run the following code :
import numpy as np
import tensorflow as tf
K = 4
with tf.device('/gpu:0'):
X = tf.constant(np.array([1,2,2,2,2,1,1,1,1,0,0,0,3,3,3,2,1,2,0]))
count = tf.bincount(tf.to_int32(X), minlength = 4, maxlength = 4)
sess = tf.Session(config = tf.ConfigProto( log_device_placement = True ) )
print( sess.run(count) )
And what is weird to me is that when I run the a slightly different code, it works :
import numpy as np
import tensorflow as tf
K = 4
X = tf.constant(np.array([1,2,2,2,2,1,1,1,1,0,0,0,3,3,3,2,1,2,0]))
count = tf.bincount(tf.to_int32(X), minlength = 4, maxlength = 4)
sess = tf.Session(config = tf.ConfigProto( log_device_placement = True ) )
print( sess.run(count) )
And, if I remove the tf.bincount function, it also works.
So my question is, why does tf.bincount causes an error when trying to use device placement ?
And I really need this function to work. Also, the system I'm running is an 8 K-40 GPUs with python3, tensorflow 1.2 .