2016-04-29 38 views
2

我不确定有什么问题。我检查了这个link并试图解决这个错误,但它仍然存在。我正在尝试读取csv数据,然后预测列的结果。没有额外的库,只需准备tensorflow来获得更好的理解。有任何想法吗?我想用我自己的csv数据使用TensorFlow,但看到一个无害的“Enqueue操作取消”警告

enter image description here

编辑:

代码:

import tensorflow as tf 

filename_queue = tf.train.string_input_producer(["keystrokes-strsep.csv"]) 

reader = tf.TextLineReader() 
key, value = reader.read(filename_queue) 

# Default values, in case of empty columns. Also specifies the type of the 
# decoded result. 
record_defaults = [[''], [''], [''], [''], ['']] 
col1, col2, col3, col4, col5 = tf.decode_csv(value, record_defaults=record_defaults) 
# print tf.shape(col1) 

init = tf.initialize_all_variables() 

features = tf.pack([col1, col2, col3, col4]) 

with tf.Session() as sess: 
    sess.run(init) 

    # Start populating the filename queue. 
    coord = tf.train.Coordinator() 
    threads = tf.train.start_queue_runners(coord=coord) 

    for i in range(114729): 
    # Retrieve a single instance: 
    example, label = sess.run([features, col5]) 

    coord.request_stop() 
    coord.join(threads) 

错误:

W tensorflow/core/common_runtime/executor.cc:1102] 0x7fe343d3fa40 Compute status: Cancelled: Enqueue operation was cancelled 
    [[Node: input_producer/input_producer_EnqueueMany = QueueEnqueueMany[Tcomponents=[DT_STRING], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](input_producer, input_producer/RandomShuffle)]] 
I tensorflow/core/kernels/queue_base.cc:286] Skipping cancelled enqueue attempt 

回答

1

这实际上是一个正常的操作信息,而不是错误。此消息表示当您执行request_stop时,有记录等待被推入队列。特别是,你会看到,如果你的CVS文件有超过1200 + queue capacity记录。

+0

哦,好吧谢谢!我想我会尝试使用numpy代替然后,因为这种方法不能读取很多csv条目 – Sticky

+0

实际上这种方法比numpy更具可扩展性,因为它可以使用多个线程来读取数据 –

+0

由Google完成=确实更具可扩展性:P除了我需要它的工作xD 你建议我为解决队列容量问题做什么?我刚刚开始了解TensorFlow及其库文件 – Sticky

相关问题