【问题标题】:Evaluating images of different size on Tensorflow Deeplab在 Tensorflow Deeplab 上评估不同尺寸的图像
【发布时间】:2018-06-05 15:11:38
【问题描述】:

我正在尝试创建一个评估图像的服务。为了提高性能,我尝试在所有图像上使用相同的网络。我使用 inference.py 作为起点 (https://github.com/hellochick/Indoor-segmentation/blob/master/inference.py) 并将 net 变量移至全局范围,将其更改为:

img_ph = tf.placeholder(tf.float32, shape = [None, None, None, 3])
net = DeepLabResNetModel({'data': img_ph}, is_training=False, num_classes=NUM_CLASSES)

但我在评估图像时收到以下错误:

文件 "\Python36\lib\site-packages\tensorflow\python\framework\ops.py", 第 5573 行,在 _assert_same_graph original_item)) ValueError: Tensor("strided_slice:0", shape=(2,), dtype=int32) 必须来自 与 Tensor("fc_out/Conv2D:0", shape=(?, ?, ?, 27), dtype=float32)。

这是在带有 Python3 的 Windows 服务器上运行的。

感谢您的任何指点。

【问题讨论】:

    标签: tensorflow


    【解决方案1】:

    我找到了答案。我应该在运行会话时提供图像:

    preds = sess.run(pred,feed_dict={img_ph: imgsrc})
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-02-28
      • 1970-01-01
      • 1970-01-01
      • 2016-05-14
      • 1970-01-01
      • 1970-01-01
      • 2018-12-19
      • 1970-01-01
      相关资源
      最近更新 更多