I have two similar tensors; one has all the found valid boxes, and the other has all of the indexes where they belonged.
Tensor("valid_boxes:0", shape=(?, 9), dtype=float32)
Tensor("valid_boxes_indexes:0", shape=(?, 4), dtype=int64)
I need a map_fun
which access both variables. I tried this:
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 gave me the following:
ValueError: The two structures don't have the same nested structure.
First structure: type=tuple str=(tf.float32, tf.int64)
Second structure: type=Tensor str=Tensor("map_14/while/stack:0", shape=(5,), dtype=float32)
More specifically: Substructure "type=tuple str=(tf.float32, tf.int64)" is a sequence, while substructure "type=Tensor str=Tensor("map_14/while/stack:0", shape=(5,), dtype=float32)" is not
Is there any way to do this properly?
Thanks!