在Tensorflow.python.ops.bincount_ops.bincount上发生段错误,

dauxcl2d  于 10个月前  发布在  Python
关注(0)|答案(4)|浏览(93)

问题类型

Bug

你是否在TF nightly版本中复现了这个bug?

来源

source

Tensorflow版本

2.13.0

自定义代码

OS平台和发行版

Ubuntu 22.04

移动设备

  • 无响应*

Python版本

3.9

Bazel版本

  • 无响应*

GCC/编译器版本

  • 无响应*

CUDA/cuDNN版本

  • 无响应*

GPU型号和内存

  • 无响应*

当前行为?

  1. Segfault

独立代码以重现问题

  1. import tensorflow as tf
  2. import os
  3. import numpy as np
  4. from tensorflow.python.ops import bincount_ops
  5. try:
  6. arg_0_tensor = tf.random.uniform([3, 1], minval=-256, maxval=257, dtype=tf.int32)
  7. arg_0 = tf.identity(arg_0_tensor)
  8. weights = None
  9. minlength = 2
  10. maxlength = 0
  11. dtype = "float32"
  12. axis = -1
  13. binary_output = True
  14. out = bincount_ops.bincount(
  15. arg_0,
  16. weights=weights,
  17. minlength=minlength,
  18. maxlength=maxlength,
  19. dtype=dtype,
  20. axis=axis,
  21. binary_output=binary_output,
  22. )
  23. except Exception as e:
  24. print("Error:" + str(e))
  1. import tensorflow as tf
  2. import os
  3. import numpy as np
  4. from tensorflow.python.ops import bincount_ops
  5. try:
  6. arg_0_tensor = tf.random.uniform([3, 1], minval=-256, maxval=257, dtype=tf.int32)
  7. arg_0 = tf.identity(arg_0_tensor)
  8. weights = None
  9. minlength = 4
  10. maxlength = 0
  11. dtype = "float32"
  12. axis = -1
  13. binary_output = True
  14. out = bincount_ops.bincount(arg_0,weights=weights,minlength=minlength,maxlength=maxlength,dtype=dtype,axis=axis,binary_output=binary_output,)
  15. except Exception as e:
  16. print("Error:"+str(e))

相关日志输出

  1. Error:maxlength: Tensor conversion requested dtype int32 for Tensor with dtype float32: <tf.Tensor: shape=(), dtype=float32, numpy=0.5696368>
  2. Error:arr: Tensor conversion requested dtype int32 for Tensor with dtype int64: <tf.Tensor: shape=(10000,), dtype=int64, numpy=array([-123, 137, 225, ..., -163, -81, 75])>
  3. Error:Unsupported value for argument axis=-3. Only 0 and -1 are currently supported.
  4. Error:Attempt to convert a value (None) with an unsupported type (<class 'NoneType'>) to a Tensor.
  5. Error:Attempt to convert a value (None) with an unsupported type (<class 'NoneType'>) to a Tensor.
  6. Error:{{function_node __wrapped__Bincount_device_/job:localhost/replica:0/task:0/device:CPU:0}} Input arr must be non-negative! [Op:Bincount]
  7. Error:Attempt to convert a value (None) with an unsupported type (<class 'NoneType'>) to a Tensor.
  8. Error:arr: Tensor conversion requested dtype int32 for Tensor with dtype int8: <tf.Tensor: shape=(10000,), dtype=int8, numpy=array([105, -62, 101, ..., 105, -43, -41], dtype=int8)>
  9. Error:arr: Tensor conversion requested dtype int32 for Tensor with dtype int64: <tf.Tensor: shape=(10000,), dtype=int64, numpy=array([-159, -131, 160, ..., 169, 71, -14])>
  10. Error:Attempt to convert a value (None) with an unsupported type (<class 'NoneType'>) to a Tensor.
  11. Error:arr: Tensor conversion requested dtype int32 for Tensor with dtype bool: <tf.Tensor: shape=(), dtype=bool, numpy=False>
  12. Error:arr: Tensor conversion requested dtype int32 for Tensor with dtype int64: <tf.Tensor: shape=(10000,), dtype=int64, numpy=array([ 162, 215, -202, ..., -21, -92, 236])>
  13. Error:Attempt to convert a value (None) with an unsupported type (<class 'NoneType'>) to a Tensor.
  14. Error:Attempt to convert a value (None) with an unsupported type (<class 'NoneType'>) to a Tensor.
  15. Error:{{function_node __wrapped__Bincount_device_/job:localhost/replica:0/task:0/device:CPU:0}} Input arr must be non-negative! [Op:Bincount]
  16. Error:{{function_node __wrapped__Bincount_device_/job:localhost/replica:0/task:0/device:CPU:0}} Input arr must be non-negative! [Op:Bincount]
  17. Error:{{function_node __wrapped__Bincount_device_/job:localhost/replica:0/task:0/device:CPU:0}} Input arr must be non-negative! [Op:Bincount]
  18. Error:Value for attr 'T' of uint32 is not in the list of allowed values: int32, int64, float, double
  19. ; NodeDef: {{node Bincount}}; Op<name=Bincount; signature=arr:int32, size:int32, weights:T -> bins:T; attr=T:type,allowed=[DT_INT32, DT_INT64, DT_FLOAT, DT_DOUBLE]> [Op:Bincount]
  20. Error:Attempt to convert a value (None) with an unsupported type (<class 'NoneType'>) to a Tensor.
  21. Error:arr: Tensor conversion requested dtype int32 for Tensor with dtype int64: <tf.Tensor: shape=(10000,), dtype=int64, numpy=array([-98, 135, 191, ..., 129, 218, 106])>
  22. Error:Attempt to convert a value (None) with an unsupported type (<class 'NoneType'>) to a Tensor.
  23. Error:Attempt to convert a value (None) with an unsupported type (<class 'NoneType'>) to a Tensor.
  24. Error:arr: Tensor conversion requested dtype int32 for Tensor with dtype int64: <tf.Tensor: shape=(1000,), dtype=int64, numpy=
  25. array([ -60, 157, 215, 79, 195, 18, -112, -82, -116, 31, 220,
  26. 218, 175, -7, -152, -37, -190, -253, 58, 63, 128, 117,
  27. -189, -4, -97, 9, 237, -33, -235, -211, 2, -244, 104,
  28. 5, -158, 144, 165, -19, -42, 234, -65, -207, -15, 81,
  29. 206, 135, -119, 97, 173, 254, 254, 122, -175, 229, -256,
  30. 61, 204, -32, -213, -238, -23, -221, -60, -229, 243, -9,
  31. 50, -243, -34, 103, -233, 183, 171, 228, -122, 234, 94,
  32. 161, -255, 184, -84, 215, -62, 69, 202, 64, -159, -256,
  33. -133, 127, -133, 135, -105, 129, 114, 49, -217, -209, 133,
  34. 252, 25, 66, 24, 208, -222, -206, -84, 58, 55, -130,
  35. 42, -23, 94, 68, 119, -53, -191, -146, 129, 98, -74,
  36. 172, 143, -93, 121, 175, 196, -245, -79, 26, 46, 132,
  37. -37, 141, 118, -160, -74, 108, -62, -241, 130, -173, 241,
  38. 71, 242, 34, 237, -4, -230, -122, -221, -185, 246, 39,
  39. -58, 42, 2, -252, 108, -246, -135, 211, 66, 18, 196,
  40. -146, 172, -87, 119, -91, -137, -120, 146, -139, 116, -25,
  41. -244, 19, 52, -241, 229, 177, -187, -89, -189, 41, -175,
  42. 31, 183, 191, 64, 113, 68, 114, -186, -73, -115, -38,
  43. -248, -228, 51, -1, 60, 150, 124, 169, -21, 202, -71,
  44. 112, 192, 182, 34, -95, 152, 58, 179, 23, 133, 38,
  45. 218, -154, 39, -70, -57, -230, -164, 14, 199, -182, 101,
  46. -241, -91, -133, -13, 240, 76, 142, -16, 3, 22, 249,
  47. -197, -101, -1, 155, -184, 178, -146, 92, -70, -154, -145,
  48. -112, -135, -233, -95, -7, -204, -99, 149, -201, -94, -15,
  49. 89, 31, 127, -14, -145, -191, -11, 23, -73, 238, -11,
  50. -93, 199, 145, 119, 18, 114, 240, 118, -101, -6, 63,
  51. -52, -50, 69, -77, -16, -91, -245, -98, -72, -27, 46,
  52. 241, 11, 239, 212, 252, -124, -213, -19, 104, -203, 70,
  53. 147, 94, -28, 99, -129, 20, -66, 175, -88, 244, 35,
  54. 117, -136, -14, 38, -216, 15, 69, -50, -206, -95, -203,
  55. 9, -15, -40, 183, 176, 210, 100, 73, -13, -76, -52,
  56. -249, -131, 255, 118, 175, -166, -211, 20, 211, 148, 164,
  57. 249, 252, -67, 164, -240, -174, 184, -64, -223, 35, 41,
  58. -151, 57, -140, 86, 93, -206, -188, -126, 117, -50, -246,
  59. -18, -251, -145, 79, -193, -120, -50, -32, 118, -215, -55,
  60. -9, 62, 190, -61, -3, 231, 133, -226, 11, -205, -155,
  61. -115, 125, 239, -186, 50, 179, 217, 48, 214, 171, 246,
  62. -243, 201, 50, 180, -35, 52, 1, -215, 183, -247, -138,
  63. 160, 249, 101, 150, -99, 43, -210, -180, -44, -12, 59,
  64. 124, 27, -247, 27, -19, -12, -172, -165, 190, 231, 52,
  65. 206, 170, 236, -132, -54, 163, -188, 235, -64, 101, 227,
  66. -188, 54, -119, 251, -199, 249, 26, -237, -170, 29, 87,
  67. 183, -139, -160, -119, 130, 195, -148, -85, 217, 53, -186,
  68. 243, -239, 132, 242, -56, 118, 102, -173, 209, -79, -80,
  69. 224, -92, 143, 127, -117, 72, -81, -159, 110, -45, 5,
  70. -97, 154, 123, -36, -144, 198, -119, -187, 37, 178, 16,
  71. 197, 240, 31, 26, -85, 60, -226, -145, -31, 221, -181,
  72. 193, -10, -112, -197, -203, 166, -111, -93, -189, -131, -226,
  73. 155, -124, -136, 92, 97, 124, 52, 209, 21, -81, 12,
  74. -71, -221, 54, -183, 96, 87, -202, 135, -83, 233, 56,
  75. 256, -27, -69, -42, 242, -151, -61, 209, 194, -137, -211,
  76. 197, 33, 24, 95, 1, 49, -168, 220, -188, 205, 206,
  77. 214, 59, -55, 131, -182, 108, 211, 15, -4, 82, -86,
  78. -135, 67, -44, 141, -52, -205, 90, -32, -128, -112, 213,
  79. -181, -134, 13, 195, 248, -81, 59, -148, -83, 132, -7,
  80. 158, 20, 202, 154, -147, -155, 8, -65, 59, 229, -16,
  81. -221, -227, -130, -104, -15, -194, 53, 80, 33, 128, 165,
  82. 153, -151, -83, -188, 72, -104, 15, -62, -31, 213, -4,
  83. 156, -170, 12, -70, 131, 154, -126, -230, 16, 195, -178,
  84. -252, 0, 20, -19, 192, -181, 85, 168, 195, -164, 156,
  85. -176, -81, -126, -123, 96, 30, 79, 247, -27, 54, 120,
  86. 100, 126, 108, -117, 122, 78, -108, 226, 77, 10, 53,
  87. -208, -35, -239, -149, -84, 14, 98, -179, 75, 172, -43,
  88. -209, -36, 239, -118, -232, -200, -230, -167, -9, -224, 195,
  89. -48, 224, 152, -20, -8, 112, -89, 159, 47, -27, -212,
  90. 51, 169, 121, 192, -236, -254, -252, -240, 95, 217, -17,
  91. -88, 70, 191, 59, -185, 234, 71, 83, -61, -147, 176,
  92. -61, 28, 44, -225, 8, -186, 77, 103, -186, -243, 72,
  93. 54, 0, 210, 88, 52, -182, 247, -181, 31, 164, 25,
  94. -144, 54, -57, 203, 15, 42, 207, -89, 12, -109, 28,
  95. -242, 110, 170, -25, 182, 20, 73, -135, -104, 221, -146,
  96. -199, -186, -231, -28, -68, 9, 158, 57, 78, -116, -167,
  97. -1, 117, -250, -118, 19, 171, 15, -73, -102, 137, 178,
  98. 166, 255, -59, 208, -77, -217, 239, -67, 84, -167, 194,
  99. 161, 222, -97, -193, 248, -145, 25, -139, -35, 226, 21,
  100. 91, -98, 189, -96, -14, -214, 218, 236, -32, -156, 49,
  101. -108, 81, -7, -160, 74, 17, -221, -160, 130, 39, 97,
  102. -108, 55, -23, -104, 191, -216, -175, 134, 109, 43, -102,
  103. -166, 73, -142, 240, 78, -112, 145, 67, 74, -207, 180,
  104. 100, 163, -148, -202, -122, 55, 70, -142, -197, -87, -254,
  105. -62, -129, -65, -106, -204, 140, 30, 160, -13, -167, -103,
  106. 250, -57, -123, 169, -64, -183, 19, -76, -207, -153, -128,
  107. 111, -85, -58, -148, -104, 91, 183, 212, 126, 122, 60,
  108. -207, -62, -201, 175, 221, 195, -189, -31, -193, -216, 165,
  109. 36, 240, -202, 156, -237, -94, -138, -82, -130, -73, -145,
  110. 24, 21, 237, 57, -213, -31, 187, 99, -173, -139, 181,
  111. -171, -62, 171, 178, -245, -75, -235, 20, -7, -15, 91,
  112. 199, -37, -245, -237, 164, -181, -42, 119, -1, 114, -200,
  113. 209, -42, 12, 113, -31, 31, -162, 191, 83, 217, 70,
  114. -2, -155, 57, 11, 232, -89, 163, -243, -113, 194, 95,
  115. -156, 251, -76, -154, -225, -126, 234, 148, -96, -105])>
  116. Error:Attempt to convert a value (None) with an unsupported type (<class 'NoneType'>) to a Tensor.
  117. Error:Attempt to convert a value (None) with an unsupported type (<class 'NoneType'>) to a Tensor.
  118. Segmentation fault
  1. </details>
v1l68za4

v1l68za41#

@nimashiri 一旦合并PR,这个问题就会被关闭。
谢谢!

35g0bw71

35g0bw712#

@learning-to-play

pdtvr36n

pdtvr36n3#

在2.13.0版本上存在段错误。

vddsk6oq

vddsk6oq4#

@dmc1778 跟进问题负责人是一个好主意,他们可以帮助将问题分配给正确的人。
@sachinprasadhs 你可以和TF Ops团队一起寻找正确的人吗?

相关问题