Open
Description
Requesting support for the missing Operator "TensorListConcatV2"
Hi, I am getting the following error with opset=18:
Tensorflow op [TensorListConcatV2_4: TensorListConcatV2] is not supported
Tensorflow op [TensorListConcatV2_3: TensorListConcatV2] is not supported
Tensorflow op [TensorListConcatV2_2: TensorListConcatV2] is not supported
Tensorflow op [TensorListConcatV2_1: TensorListConcatV2] is not supported
Tensorflow op [TensorListConcatV2: TensorListConcatV2] is not supported
Unsupported ops: Counter({'TensorListConcatV2': 5})
A small toy example to reproduce the error:
import tensorflow as tf
import tf2onnx
class ExampleModel(tf.keras.Model):
def __init__(self, input_shape):
super(ExampleModel, self).__init__()
self.build(input_shape)
def call(self, inputs, training = False):
ta = tf.TensorArray(tf.int32, size=3)
ta = ta.write(0, tf.constant([1, 2]))
ta = ta.write(1, tf.constant([3, 4]))
ta = ta.write(2, tf.constant([5, 6]))
return ta.concat()
example_model = ExampleModel((1, 100, 100, 3))
output_path = "./concat_model.onnx"
onnx_model = tf2onnx.convert.from_keras(example_model, (tf.TensorSpec((1, 100, 100, 3), tf.float32, name="input_1"),), opset=18, output_path=output_path)
Toy example output
Tensorflow op [example_model_3/TensorListConcatV2: TensorListConcatV2] is not supported
Unsupported ops: Counter({'TensorListConcatV2': 1})
FYI: In spite of above error/warning, model got saved and with
import onnxruntime as ort
session = ort.InferenceSession(output_path, providers=ort.get_available_providers())
got the following error from onnxruntime:
InvalidGraph: [ONNXRuntimeError] : 10 : INVALID_GRAPH : Load model from [/path/to/concat_model.onnx]( failed:This is an invalid model. In Node, ("example_model/TensorArrayV2", TensorListReserve, "", -1) : ("example_model/TensorArrayV2/element_shape:0": tensor(int32),"example_model/TensorArrayV2/num_elements:0": tensor(int32),) -> ("example_model/TensorArrayV2:0",) , Error No Op registered for TensorListReserve with domain_version of 18
could you please help me?