4Manuals

  • PDF Cloud HOME

使用tf.image.crop_and_resize的OutOfRangeError Download

    如何将文本边界框与pyplot.Rectangle对齐? 导入类问题 在Python数据框中选择列时出错 使用Rabbit的pika确认消息 如何在按住键的同时暂停VideoStream? Python OpenCV TypeError:无法处理此数据类型 使用buildozer不会下载sdl2_image SMTPSenderRefused,421,超出超时 Tensorflow多线程推理比单线程推理慢 关于python中变量的困惑。 python如何使用变量?

我的代码如下。

class RecogFeatureGraph(): 
    """  Importing and running pixel link graph """
    def __init__(self,fatness,image_shape):
        self.input_dat = tf.placeholder(dtype=tf.float32, shape=(None,30,80,256))
        self.boxes = tf.placeholder(dtype=tf.float32, shape=(16,4))
        self.box_indices = tf.placeholder(dtype=tf.int32, shape=(16,))
        self.sess = tf.Session(graph = tf.get_default_graph())
        self.rec_fmap = tf.image.crop_and_resize(self.input_dat, self.boxes, self.box_indices, [16, 70], method='bilinear', extrapolation_value=0, name='crop_resize')

    def run(self, input_dat, in_boxes, box_indices):
        return self.sess.run([self.rec_fmap], feed_dict={self.input_dat: input_dat, self.boxes:in_boxes, self.box_indices:box_indices})

input_dat.shape是(12, 30, 80, 256)。

收件箱是

array([[0.13, 0.31, 0.37, 0.75],
       [0.4 , 0.17, 0.63, 0.62],
       [0.23, 0.19, 0.54, 0.78],
       [0.08, 0.21, 0.42, 0.4 ],
       [0.46, 0.07, 0.79, 0.54],
       [0.11, 0.32, 0.5 , 0.53],
       [0.53, 0.13, 0.93, 0.67],
       [0.34, 0.26, 0.63, 0.89],
       [0.38, 0.3 , 0.7 , 0.86],
       [0.14, 0.08, 0.48, 0.8 ],
       [0.26, 0.04, 0.57, 0.71],
       [0.2 , 0.35, 0.47, 0.78],
       [0.33, 0.28, 0.6 , 0.51],
       [0.61, 0.21, 0.88, 0.59],
       [0.17, 0.07, 0.49, 0.64],
       [0.09, 0.05, 0.42, 0.65]], dtype=float32)

box_indices是

array([ 0,  1,  2,  3,  3,  4,  4,  5,  6,  7,  8,  9, 10, 10, 11, 12],
      dtype=int32)

因此box_indices在input_dat范围内。

为什么会有OutOfRangeError?

我的张量流是1.14.0。

0 个答案:

没有答案



Similar searches
    我向WordPress子主题文件添加了内联样式。它们在页面上呈现,但不在主题文件中呈现 如何使用php插入发布值到MYSQL 使用命名空间提取SimpleXML属性 如何在ag-grid中减去2行值并在另一行中显示结果 在应用程序引擎中使用特定路径覆盖通配符dispatch.yaml条目