def read_csv(batch_size,file_name):
filename_queue = tf.train.string_input_producer([file_name])
reader = tf.TextLineReader(skip_header_lines=0)
key,value = reader.read(filename_queue)
decoded = tf.decode_csv(value,field_delim=' ',
record_defaults=[[0] for i in range(nlp_segment.flags.max_sentence_len*2)])
return tf.train.shuffle_batch(decoded,
batch_size=batch_size,
capacity=batch_size*50,
min_after_dequeue=batch_size)
评论列表
文章目录