I have a quantized tensorflow model file, and also define a UDO (json format file). The model defines an OwnOnednnMul and FsmnForward operation, but when it is converted to dlc format through snpe-tensorflow-to-dlc (command line: snpe -tensorflow-to-dlc --input_network model.pb --input_dim xxxx --out_node output --output_path model.dlc --udo udo.json --show_unconsumed_nodes), the following error will appear:
qti.aisw.converters.tensorflow.util.ConverterError: ERROR_TF_INPUT_OPERATION_NOT_FOUND: Input operation not found for Inference/split
2021-06-17 15:52:34,624-183-ERROR-Conversion FAILED: build_layer failed with Exception ERROR_TF_INPUT_OPERATION_NOT_FOUND: Input operation not found for Inference/split in layer SliceLayerBuilder
Traceback (most recent call last):
File "/opt/snpe-1.50.0.2622/lib/python/qti/aisw/converters/tensorflow/tf_to_ir.py", line 548, in _create_layer
layer_builder.build_layer(self.graph, self._context, descriptor, inputs, outputs)
File "/opt/snpe-1.50.0.2622/lib/python/qti/aisw/converters/tensorflow/layers/slice.py", line 75, in build_layer
input_shape = converter_context.get_input_layer_output_shape_for(descriptor.child_ops[0])
File "/opt/snpe-1.50.0.2622/lib/python/qti/aisw/converters/tensorflow/tf_to_ir.py", line 200, in get_input_layer_output_shape_for
output_op = self._get_input_layer_output_op_for(operation, idx)
File "/opt/snpe-1.50.0.2622/lib/python/qti/aisw/converters/tensorflow/tf_to_ir.py", line 261, in _get_input_layer_output_op_for
raise ConverterError(code_to_message.get_error_message('ERROR_TF_INPUT_OPERATION_NOT_FOUND')(operation.name))
qti.aisw.converters.tensorflow.util.ConverterError: ERROR_TF_INPUT_OPERATION_NOT_FOUND: Input operation not found for Inference/split
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/snpe-1.50.0.2622/bin/x86_64-linux-clang/snpe-tensorflow-to-dlc", line 52, in main
ir_graph = converter.convert()
File "/opt/snpe-1.50.0.2622/lib/python/qti/aisw/converters/tensorflow/tf_to_ir.py", line 339, in convert
self._convert_layers()
File "/opt/snpe-1.50.0.2622/lib/python/qti/aisw/converters/tensorflow/tf_to_ir.py", line 390, in _convert_layers
self._create_layers(descriptors)
File "/opt/snpe-1.50.0.2622/lib/python/qti/aisw/converters/tensorflow/tf_to_ir.py", line 440, in _create_layers
self._create_layer(layer_builder, descriptor)
File "/opt/snpe-1.50.0.2622/lib/python/qti/aisw/converters/tensorflow/tf_to_ir.py", line 553, in _create_layer
(e, layer_builder.__class__.__name__))
qti.aisw.converters.tensorflow.util.ConverterError: build_layer failed with Exception ERROR_TF_INPUT_OPERATION_NOT_FOUND: Input operation not found for Inference/split in layer SliceLayerBuilder
The content of the UDO file is as follows:
{
"UdoPackage_0":
{
"Operators": [
{
"type": "OwnOnednnMul",
"inputs":[
{"name": "input", "data_type": "INT_32", "quantization_mode":"TF"}
],
"outputs":[
{"name": "output", "data_type": "INT_32"}
],
"core_types": ["DSP"],
"dsp_arch_types": ["v68"]
},
{
"type": "FsmnForward",
"inputs":[
{"name": "input", "data_type": "INT_32", "quantization_mode":"TF"}
],
"outputs":[
{"name": "out", "data_type": "INT_32"}
],
"core_types": ["DSP"],
"dsp_arch_types": ["v68"]
}
],
"UDO_PACKAGE_NAME": "XXUDOPackage"
}
}
How can I solve this problem? This problem has been blocked for several days. Any help in solving this issue will be greatly appreciated.
snpe-tensorflow-to-dlc conversion failed in tf with UDO
Posted: Thu, 2021-06-17 01:03
you try to use udo with onnx model? and you can add output which your cuntom op with shape. good luck