【发布时间】:2019-10-18 23:07:38
【问题描述】:
我有一个代码使用 tensorflow 通过 GPU 分析一些图像,我使用 tf.session 并在模型的 session.run 中引入帧
with tf.Session() as sess:
res, img = cap.read()
heatmaps_result, offsets_result, displacement_fwd_result, displacement_bwd_result = sess.run(model_outputs,feed_dict={'image:0': my_batch[0]})
当我在 GPU 上运行它时,它有空闲空间,所以我想介绍几张图片。我已经尝试了Bach several images in tensorflow 中所说的,但我得到了错误:
“名称‘image_tensor:0’指的是一个不存在的Tensor。操作‘image_tensor’在图中不存在。”
我已将 bach 中的图像介绍为:
cnt = 0
my_batch = list()
while (cnt < 5):
cnt = cnt + 1
res, img = cap.read()
if not res:
break
my_batch.append(img)
【问题讨论】:
标签: python tensorflow