I'm trying to read a tensor from a CSV file and print it. I followed the advice here, but the script still hangs. data.csv consists of one line:
1.5,2.5
Here's the code that reads it:
datafile = tf.train.string_input_producer([os.path.join(os.getcwd(), "data.csv")])
reader = tf.TextLineReader()
_, value = reader.read(datafile)
record_defaults = [[1], [1]]
col1, col2 = tf.decode_csv(value, record_defaults=record_defaults)
result = tf.stack([col1, col2])
config = tf.ConfigProto(inter_op_parallelism_threads=2)
with tf.Session() as sess:
print(sess.run(result))
Any thoughts?