【问题标题】:Tensorflow Error : Cannot assign a device for operation 'Bincount' ... because no supported kernel for GPU devices is availableTensorflow 错误:无法为操作“Bincount”分配设备……因为没有支持的 GPU 设备内核可用
【发布时间】:2017-08-07 22:20:15
【问题描述】:

所以,我收到以下错误:

" 无法为操作“Bincount_1”分配设备:无法满足明确的设备规范“/device:GPU:0”,因为没有支持的 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 在尝试使用设备放置时会导致错误?

我真的需要这个功能才能工作。 另外,我正在运行的系统是一个 8 K-40 GPUs with python3, tensorflow 1.2 。

【问题讨论】:

    标签: python-3.x tensorflow


    【解决方案1】:

    我找到了答案,目前gpu中不支持tf.bincount(...)。

    https://github.com/tensorflow/tensorflow/issues/11554有一个请求

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-23
      • 2020-10-09
      • 2020-02-22
      • 1970-01-01
      • 2020-05-10
      • 2015-12-05
      相关资源
      最近更新 更多