Hi:
I am trying to compile a ssd_mobilenet_v1 model from Tensorflow with TVM. This model comes from TensorFlow 1 Detection Model Zoo
According to this post, all object detection models have been tested.
But when I compile this ssd model, the relay.frontend.from_tensorflow
fails. After I digging into the model, it seems that the input tensors of Select
have dynamic shapes, which results into the failure.
This example can show that when one input tensor of Select
has dynamic shape, the relay.frontend.from_tensorflow
will fail
import tensorflow as tf
from tvm import relay
def test_select_graph():
test_graph = tf.Graph()
with test_graph.as_default():
c = tf.placeholder(dtype=tf.bool, shape=(100,), name='cond')
x = tf.placeholder(dtype=tf.float32, shape=(None,), name='x')
y = tf.placeholder(dtype=tf.float32, shape=(100,), name='y')
r = tf.raw_ops.Select(condition=c, x=x, y=y, name='Select')
test_graph_def = test_graph.as_graph_def()
mod, params = relay.frontend.from_tensorflow(
test_graph_def, layout='NCHW', outputs=['Select']
)
if __name__ == '__main__':
test_select_graph()