Forums - input encoding

2 posts / 0 new
Last post
input encoding
gal.safra
Join Date: 6 May 21
Posts: 3
Posted: Tue, 2022-01-04 04:44

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?

  • Up0
  • Down0
weihuan
Join Date: 12 Apr 20
Posts: 270
Posted: Sun, 2022-01-09 16:56

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

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.