I\'m trying to read data from CSV files to tensorflow,
https://www.tensorflow.org/versions/r0.7/how_tos/reading_data/index.html#filenames-shuffling-and-epoch-limits
You definitely don't need to define col1, col2, to col1000...
generally, you might do things like this:
columns = tf.decode_csv(value, record_defaults=record_defaults)
features = tf.pack(columns)
do_whatever_you_want_to_play_with_features(features)
I do not know any off-the-shelf way to directly read data from MongoDB. Maybe you can just write a short script to convert data from MongoDB in a format that Tensorflow supports, I would recommend binary form TFRecord
, which is much faster to read than csv record. This is a good blog post about this topic. Or you can choose to implement a customized data reader by yourself, see the official doc here.