1
私はテンソルをCSVファイルから読み込み、それを印刷しようとしています。私は助言hereに従ったが、スクリプトはまだハングアップする。 data.csvは1行で構成されていますTensorFlowでCSVファイルを読む
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))
任意の考え:
1.5,2.5
ここでそれを読み込むコードですか?
ああ、ありがとうございました。別の投稿が推奨しているので、私は設定行を追加しました。 – user934904