tensorflow : .eval() never ends

后端 未结 1 1994
暗喜
暗喜 2020-12-18 05:19

i am loading the cifar-10 data set , the methods adds the data to tensor array , so to access the data i used .eval() with session , on a normal tf constant it return the va

相关标签:
1条回答
  • 2020-12-18 05:48

    You must call tf.train.start_queue_runners(sess) before you call train_data.eval() or train_labels.eval().

    This is a(n unfortunate) consequence of how TensorFlow input pipelines are implemented: the tf.train.string_input_producer(), tf.train.shuffle_batch(), and tf.train.batch() functions internally create queues that buffer records between different stages in the input pipeline. The tf.train.start_queue_runners() call tells TensorFlow to start fetching records into these buffers; without calling it the buffers remain empty and eval() hangs indefinitely.

    0 讨论(0)
提交回复
热议问题