tensorflow---文字识别

读取数据的三种方法:

1. feeding : providing data when running each step : classifier.eval(feed_dict={input:my_python_preprocessing_fn() }),当包含变量常量时,最好使用placeholder。 

2. reading from files:  an input pipline reads data from files at the begining of the graph: 

reader=tf.TextLineReader()

key,value=reader.read(filename_queue)

c1,c2,c3,c4=tf.decode_csv(value)

3. Preloaded data: a variable in Tensorflow graph holds all the data: only suitable for small data sets

 

对于实际的问题,不能像mnist 一样直接读入所有数据到内存。

 

使用TFRecord来进行数据读取,在程序运行中异步读取数据,然后shuffle batch, 再feed到模型的Graph 中。

posted @ 2017-10-08 11:11  hahahaf  阅读(713)  评论(0编辑  收藏  举报