2017-09-14 11 views
0

テンソルフローtutorialをここで実行しようとしています。 〜100個のイメージを持つtfレコードファイルを作成します。次のようにしようとすると、カーネルがハングアップします。なぜこうなった? TF記録ファイルが大きいだけで30メガバイトの+またはそうではない、それはそれらを読むために時間はかからないはず。TFレコードファイルの読み取りに非常に時間がかかる

import tensorflow as tf 
import os 

print(os.path.exists("../carmakesorter/train-00000-of-00001")) 

filenameQ = tf.train.string_input_producer(["../carmakesorter/train-00000-of-00001"],num_epochs=None) 

# object to read records 
recordReader = tf.TFRecordReader() 

# read the full set of features for a single example 
key, fullExample = recordReader.read(filenameQ) 

# parse the full example into its' component features. 
features = tf.parse_single_example(
    fullExample, 
    features={ 
     'image/height': tf.FixedLenFeature([], tf.int64), 
     'image/width': tf.FixedLenFeature([], tf.int64), 
     'image/colorspace': tf.FixedLenFeature([], dtype=tf.string,default_value=''), 
     'image/channels': tf.FixedLenFeature([], tf.int64),    
     'image/class/label': tf.FixedLenFeature([],tf.int64), 
     'image/class/text': tf.FixedLenFeature([], dtype=tf.string,default_value=''), 
     'image/format': tf.FixedLenFeature([], dtype=tf.string,default_value=''), 
     'image/filename': tf.FixedLenFeature([], dtype=tf.string,default_value=''), 
     'image/encoded': tf.FixedLenFeature([], dtype=tf.string, default_value='') 
    }) 

label = features['image/class/label'] 
with tf.Session() as sess: 
    print('start ...') 
    print(sess.run(label))    # I want to check the label here 
    print('end ...') 

それは印刷されます。

True 
start ... 

マイノートカーネルは10分、すでに、私のためにハングアップします終わりがあるのを見ないでください。誰かが間違っていることを指摘できますか?

答えて

2

'tf.train.start_queue_runners(sess)'を使用してキューランナーを実行するのを忘れた

関連する問題