tf.decode_csv参数"标签"的数据类型 float64 不在允许的值列表中:int32、int64



试图将TensorFlow tf.decode_csv float64数据类型传递,但出现错误是不允许的

CSV_TYPES = [[0.0], [2.], [0.0], [0.0], [0.0], [0]]
def _parse_line(line):
fields = tf.decode_csv(line, record_defaults=CSV_TYPES)

问题是第二个值,例如这是我的值

9.5,-110,9.5,50,68,1
9.5,+100,9.5,50,32,0
7,-110,7,30,24,1
7,-120,70,76,0

这将产生以下错误:

TypeError: Value passed to parameter 'labels' has DataType float64 not in list of allowed values: int32, int64

看到很多关于这个问题的讨论,但无法弄清楚如何允许标签具有 DataType float64

划伤,我的.csv文件中有一个错误。

相关内容

最新更新