Tensorflow错误:无法分配装置操作“Bincount” ......因为GPU设备不支持的内核可
问题描述:
所以,我发现了以下错误:Tensorflow错误:无法分配装置操作“Bincount” ......因为GPU设备不支持的内核可
“无法分配装置操作' Bincount_1':无法满足明确的设备规格'/ device:GPU',因为没有支持GPU设备的内核可用 [[节点:Bincount_1 = Bincount [T = DT_INT32,_device =“/ device:GPU:0” ](ToInt32_1,Minimum_1,Const_7)]]“
对我来说,这是非常奇怪的。因为我试图运行下面的代码:
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))
什么是怪我是,当我运行一个略有不同的代码,它的工作原理:
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))
而且,如果我删除tf.bincount功能,它也有效。
所以我的问题是,为什么不尝试使用设备配置时tf.bincount导致错误?
我真的需要这个功能才能工作。 另外,我正在运行的系统是一个带有python3,tensorflow 1.2的8 K-40 GPU。