我有两个相似的张量;一个拥有所有找到的有效框,另一个拥有它们所属的所有索引。
Tensor("valid_boxes:0", shape=(?, 9), dtype=float32)
Tensor("valid_boxes_indexes:0", shape=(?, 4), dtype=int64)
我需要一个map_fun
访问这两个变量的。我试过这个:
operation = tf.map_fn(lambda x: generate_bounding_box(x[0], x[1][1], x[1][0], x[1][2], grid_h, grid_w, anchors), (valid_boxes, valid_boxes_indexes))
Tensorflow 给了我以下内容:
ValueError: 这两个结构没有相同的嵌套结构。
第一个结构:type=tuple str=(tf.float32, tf.int64)
第二种结构:type=Tensor str=Tensor("map_14/while/stack:0", shape=(5,), dtype=float32)
更具体地说:子结构 "type=tuple str=(tf.float32, tf.int64)" 是一个序列,而子结构 "type=Tensor str=Tensor("map_14/while/stack:0", shape=(5,) , dtype=float32)" 不是
有没有办法正确地做到这一点?
慕尼黑的夜晚无繁华
相关分类