1 Star 0 Fork 1

diycp2015 / imageProcessing

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
read_csv.py 987 Bytes
一键复制 编辑 原始数据 按行查看 历史
北部湾的落日 提交于 2018-05-09 09:58 . Initial commit
#-*- coding:utf-8 -*-
import tensorflow as tf
# 生成一个先入先出队列和一个QueueRunner,生成文件名队列
filenames = ['./tensorflow/csvfile/A.csv', './tensorflow/csvfile/B.csv', './tensorflow/csvfile/C.csv']
filename_queue = tf.train.string_input_producer(filenames, shuffle=False)
# 定义Reader
reader = tf.TextLineReader()
key, value = reader.read(filename_queue)
# 定义Decoder
example, label = tf.decode_csv(value, record_defaults=[['null'], ['null']])
#example_batch, label_batch = tf.train.shuffle_batch([example,label], batch_size=1, capacity=200, min_after_dequeue=100, num_threads=2)
# 运行Graph
with tf.Session() as sess:
coord = tf.train.Coordinator() #创建一个协调器,管理线程
threads = tf.train.start_queue_runners(coord=coord) #启动QueueRunner, 此时文件名队列已经进队。
for i in range(10):
print(example.eval(),label.eval())
coord.request_stop()
coord.join(threads)
1
https://gitee.com/diycp2015/imageProcessing.git
git@gitee.com:diycp2015/imageProcessing.git
diycp2015
imageProcessing
imageProcessing
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891