【发布时间】:2019-12-11 09:56:50
【问题描述】:
我在一行 csv 中有一些内容为 "1,2,'["Action","Childre"]'" 我想解码用户 tensorflow 以读取第一个入口作为 int 和最后一个作为张量。
CSV_COLUMNS=["movieId","userId","genre"]
LABEL_COLUMN="genre"
columns = tf.decode_csv('2,3,\"[\'Action,Children\']\"',record_defaults= [0.0,0.0,""])
features = dict(zip(CSV_COLUMNS, columns))
label = features.pop(LABEL_COLUMN)
with tf.Session() as sess:
sess.run(features)
sess.run(label)
结果是 {'movieId':2.0,'userId':3.0} b"['hola']"
但我希望最后的结果显示 数组(["hola"])
有什么想法吗?
【问题讨论】:
标签: string list tensorflow