Tensorflow Enqueue operation was cancelled

前端 未结 3 1654
甜味超标
甜味超标 2021-02-04 10:41

I had built a convolutional neural network in tensorflow. It is trained and now I am unpacking it and performing evaluations.

import main
import Process
import I         


        
3条回答
  •  半阙折子戏
    2021-02-04 10:50

    Everything works correctly and the problem happens at the very last stage when python tries to kill threads. To do this properly you should create a train.Coordinator and pass it to your queue_runner (no need to pass sess, as default session will be used

    with tf.Session() as sess:
        coord = tf.train.Coordinator()
        threads = tf.train.start_queue_runners(coord=coord)
        // do your things
        coord.request_stop()
        coord.join(threads)
    

提交回复
热议问题