2016-04-29 37 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

相關問題