【发布时间】:2018-08-04 12:07:09
【问题描述】:
所以,我的代码是这样的
parsed_line = tf.decode_csv(line, [[0], [0], [""]])
print(parsed_line[0])
del parsed_line[0]
del parsed_line[0]
features = parsed_line
print(parsed_line[0])
那么结果就是
[<tf.Tensor 'DecodeCSV:0' shape=() dtype=int32>, <tf.Tensor 'DecodeCSV:1' shape=() dtype=int32>, <tf.Tensor 'DecodeCSV:2' shape=() dtype=string>]
和
[<Tensor("DecodeCSV:2", shape=(), dtype=string)>]
我将给这个解码函数的 csv 是
1, 0, 0101010010101010101010
我想要这个“0101010010101010101010”
[0,1,0,1,0,.........]
在张量流中
[<Tensor("DecodeCSV:2", shape=(), dtype=string)>]
到
[<tf.Tensor 'DecodeCSV:0' shape=() dtype=int32>, <tf.Tensor 'DecodeCSV:1' shape=() dtype=int32>, ............]
你对此有什么想法吗?
【问题讨论】:
标签: tensorflow casting shape reshape tensor