Hi All,
I have an onnx model that was trained using RGB images.
when converting it to dlc (using snpe-onnx-to-dlc) using the following command -
snpe-onnx-to-dlc --input_network /home/cp/Development/models/PersonReid/OSNet/LightModels/osnet_ain_ms_d_c/osnet_ain_ms_d_c_sim.onnx --input_dim input "1,3,128,256" --input_encoding "input" rgb
i got the following error -
Encountered Error: ERROR_UNSUPPORTED_COLOR_TRANSFORMATION: Unsupported color transformation rgb to bgr. Support includes [ARGB|RGBA|NV21]To[RGB|BGR] transformations.
Stack Trace:
Traceback (most recent call last):
File "/home/cp/snpe/snpe2/snpe-1.55.0.2958/bin/x86_64-linux-clang/snpe-onnx-to-dlc", line 41, in <module>
graph = converter.convert()
File "/home/cp/snpe/snpe2/snpe-1.55.0.2958/lib/python/qti/aisw/converters/onnx/onnx_to_ir.py", line 147, in convert
onnx_translations.OnnxTranslationBase.ADD_INPUT_OP, value_info, self.graph)
File "/home/cp/snpe/snpe2/snpe-1.55.0.2958/lib/python/qti/aisw/converters/common/converter_ir/translation.py", line 51, in apply_method_to_op
return translation.apply_method(method_name, *args, **kwargs)
File "/home/cp/snpe/snpe2/snpe-1.55.0.2958/lib/python/qti/aisw/converters/common/converter_ir/translation.py", line 17, in apply_method
return self.indexed_methods[method_name](*args, **kwargs)
File "/home/cp/snpe/snpe2/snpe-1.55.0.2958/lib/python/qti/aisw/converters/onnx/onnx_translations.py", line 263, in add_input_op
return graph.add_input(name, shape)
File "/home/cp/snpe/snpe2/snpe-1.55.0.2958/lib/python/qti/aisw/converters/common/converter_ir/op_graph.py", line 623, in add_input
(input_encoding_in, input_encoding_out))
File "/home/cp/snpe/snpe2/snpe-1.55.0.2958/lib/python/qti/aisw/converters/common/utils/converter_utils.py", line 171, in log_assert
assert cond, msg.format(*args)
AssertionError: ERROR_UNSUPPORTED_COLOR_TRANSFORMATION: Unsupported color transformation rgb to bgr. Support includes [ARGB|RGBA|NV21]To[RGB|BGR] transformations.
if i remove -input_encoding "input" rgb or change it to -input_encoding "input" bgr, it works and i get a dlc file.
Can you please explain what should i do in order to give rgb inputs to the dlc?
Dear customer,
As the error messages mentioned, SNPE supports to convert below pattern conversion.
[ARGB|RGBA|NV21]To[RGB|BGR]
You need to fill the RGB(3 channel) to ARGB or RGBA(4 channel with alpha insertion) for input encoding.
BTW, what's SNPE version you worked?
BR.
Wei