TensorFlow's random_poisson only runs on CPU
我正在尝试让 TensorFlow 的
1 2 3 4 5 6 | import tensorflow as tf with tf.Session() as sess: with tf.device("/gpu:0"): test = sess.run(tf.random_poisson(1.0, [], dtype=tf.float64)) print(test) |
我得到错误:
InvalidArgumentError: Cannot assign a device for operation
'random_poisson/RandomPoissonV2': Could not satisfy explicit device
specification '/device:GPU:0' because no supported kernel for GPU
devices is available. Registered kernels: device='CPU'; R in
[DT_INT64]; dtype in [DT_INT64] device='CPU'; R in [DT_INT64]; dtype
in [DT_INT32] device='CPU'; R in [DT_INT64]; dtype in [DT_DOUBLE]
device='CPU'; R in [DT_INT64]; dtype in [DT_FLOAT] device='CPU'; R
in [DT_INT64]; dtype in [DT_HALF] device='CPU'; R in [DT_INT32];
dtype in [DT_INT64] device='CPU'; R in [DT_INT32]; dtype in
[DT_INT32] device='CPU'; R in [DT_INT32]; dtype in [DT_DOUBLE]
device='CPU'; R in [DT_INT32]; dtype in [DT_FLOAT] device='CPU'; R
in [DT_INT32]; dtype in [DT_HALF] device='CPU'; R in [DT_DOUBLE];
dtype in [DT_INT64] device='CPU'; R in [DT_DOUBLE]; dtype in
[DT_INT32] device='CPU'; R in [DT_DOUBLE]; dtype in [DT_DOUBLE]
device='CPU'; R in [DT_DOUBLE]; dtype in [DT_FLOAT] device='CPU'; R
in [DT_DOUBLE]; dtype in [DT_HALF] device='CPU'; R in [DT_FLOAT];
dtype in [DT_INT64] device='CPU'; R in [DT_FLOAT]; dtype in
[DT_INT32] device='CPU'; R in [DT_FLOAT]; dtype in [DT_DOUBLE]
device='CPU'; R in [DT_FLOAT]; dtype in [DT_FLOAT] device='CPU'; R
in [DT_FLOAT]; dtype in [DT_HALF] device='CPU'; R in [DT_HALF];
dtype in [DT_INT64] device='CPU'; R in [DT_HALF]; dtype in
[DT_INT32] device='CPU'; R in [DT_HALF]; dtype in [DT_DOUBLE]
device='CPU'; R in [DT_HALF]; dtype in [DT_FLOAT] device='CPU'; R in
[DT_HALF]; dtype in [DT_HALF][[Node: random_poisson/RandomPoissonV2 =
RandomPoissonV2[R=DT_DOUBLE, S=DT_INT32, dtype=DT_DOUBLE, seed=0,
seed2=0, _device="/device:GPU:0"](random_poisson/shape,
random_poisson/RandomPoissonV2/rate)]]
没有列出已注册的 GPU 内核。当在我的 CPU 上运行时,代码的行为与预期一样,在我的 GPU 上运行时与
谢谢!
没有用于随机泊松的 GPU 内核。在 random_poisson_op.cc 中,只注册了 CPU 内核。
如果您查看链接的
[旁白:为什么我们有一个实际上什么都不做的测试?似乎
会更好
随时通过 github 问题提交 GPU 内核的功能请求,或提交带有实现的 PR。
1 2 3 4 5 6 7 | import tensorflow as tf config = tf.ConfigProto(allow_soft_placement=True) with tf.Session(config=config) as sess: with tf.device("/gpu:0"): test = sess.run(tf.random_poisson(1.0, [], dtype=tf.float64)) print(test) |