gpt4 book ai didi

image-processing - Tensor.eval() 没有输出。 IPython 笔记本中只有一个闪烁的光标

转载 作者:行者123 更新时间:2023-11-30 09:19:59 25 4
gpt4 key购买 nike

我正在尝试读取 tensorflow 中的多个图像,这是我从 stackoverflow 中获取的代码

sess = tf.InteractiveSession() 
filenames = ['/Users/darshak/TensorFlow/1.jpg', '/Users/darshak/TensorFlow/10.jpg']
filename_queue = tf.train.string_input_producer(filenames)
reader = tf.WholeFileReader()
filename, content = reader.read(filename_queue)
image = tf.image.decode_jpeg(content, channels=3)

现在当我运行时,

image.eval()

我没有得到任何输出。只是一个闪烁的光标。如何查看是否有问题?

最佳答案

您需要启动队列运行程序。只需在创建 session 后、评估图像之前添加以下内容即可。

coord = tf.train.Coordinator()
threads = tf.train.start_queue_runners(sess=sess, coord=coord)

有关更多信息,请查看Threading and Queues .

关于image-processing - Tensor.eval() 没有输出。 IPython 笔记本中只有一个闪烁的光标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43297748/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com