- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试运行 tf.one_hot,出现 CUDA_ERROR_LAUNCH_FAILED 错误。详情如下:
示例代码:
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
电脑配置:
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 中的一个问题。
最佳答案
同时留下评论作为答案,在我的例子中是因为我没有足够的声誉来发表评论。
您是否将此报告为 GitHub 上的错误?我也可以使用相同的 Tensorflow/OS/Graphics Card/etc 确认此行为
只需将 tf.one_hot() 移至 CPU 即可为我解决问题,即类似于
与 tf.device('/cpu:0'):
b = tf.one_hot(a, 123)
关于TensorFlow GPU,tf.one_hot() 上的 CUDA_ERROR_LAUNCH_FAILED,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41115476/
我正在尝试实现本文中描述的组合算法 https://www.developertyrone.com/blog/generating-the-mth-lexicographical-element-of
我尝试运行 tf.one_hot,出现 CUDA_ERROR_LAUNCH_FAILED 错误。详情如下: 示例代码: import tensorflow as tf idx_0 = tf.place
我是一名优秀的程序员,十分优秀!