我尝试运行tf.one_hot,得到CUDA_ERROR_LAUNCH_FAILED错误。下面是详细信息:TensorFlow GPU,CUDA_ERROR_LAUNCH_FAILED on tf.one_hot()
示例代码:
import tensorflow as tf
idx_0 = tf.placeholder(tf.int64, [None])
mask = tf.one_hot(idx_0, 3, axis=-1)
sess = tf.Session()
sess.run(tf.global_variables_initializer())
a = sess.run([mask],feed_dict={idx_0:[0,1,2]})
print(a)
预期结果:
[array([[ 1., 0., 0.],
[ 0., 1., 0.],
[ 0., 0., 1.]], dtype=float32)]
实际结果:
E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\cuda\cuda_driver.cc:1177] could not synchronize on CUDA context: CUDA_ERROR_LAUNCH_FAILED :: No stack trace available
E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\cuda\cuda_event.cc:49] Error polling for event status: failed to query event: CUDA_ERROR_LAUNCH_FAILED
F c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_util.cc:370] GPU sync failed
PC的配置:
- TensorFlow 0.12.0-RC1
- 的Python 3.5
- CUDA 8.0
- cuDNN 5.1
- 操作系统:Windows 10
- GPU:的GeForce GTX 970
tf.one_hot运行正常时运行在Linux CPU,Linux GPU(GeForce GTX 660),Windows 10 CPU上。在Windows 10 GPU上不行。
在Windows 10 GPU上,tf.matmul,tf.reduce_mean,tf.reduce_sum运行正常。但tf.one_hot并不好。
这是一个错误,或者我错过了什么?谢谢。
(编辑2016年12月16日)
我已经运行在同一台机器上的代码,在Xubuntu上,GPU。代码运行良好。所以我认为这是TensorFlow-Windows中的一个问题。
谢谢。发布到https://github.com/tensorflow/tensorflow/issues/6783。 – luzi82