I got this error message converting onnx to dlc.
- python 3.5.2
- onnx 1.3
- snpe 1.36
- I checked that the slice layer have 'starts' attribute. but the converter could not find the attribute.
- in onnx >= 1.5, I got this error "RuntimeError: No schema registered for 'ScaledTanh'!". related issue https://developer.qualcomm.com/forum/qdn-forums/software/qualcomm-neural-processing-sdk/67267, onnx doesn't support python 3.4.
$ snpe-onnx-to-dlc --input_network xxxxx.onnx --output_path xxxx.dlc
Traceback (most recent call last):
File "/home/you/snpe-sdk/lib/python/snpe/converters/onnx/util.py", line 144, in extract_attributes
ret[name] = KNOWN_ATTRIBUTE_DEFAULTS[name]
KeyError: 'starts'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/you/snpe-sdk/lib/python/snpe/converters/onnx/onnx_to_ir.py", line 124, in convert
self.graph)
File "/home/you/snpe-sdk/lib/python/snpe/converters/common/converter_ir/translation.py", line 51, in apply_method_to_op
return translation.apply_method(method_name, *args)
File "/home/you/snpe-sdk/lib/python/snpe/converters/common/converter_ir/translation.py", line 17, in apply_method
return self.indexed_methods[method_name](*args)
File "/home/you/snpe-sdk/lib/python/snpe/converters/common/converter_ir/translation.py", line 120, in add_op
op = self.extract_parameters(src_op, graph)
File "/home/you/snpe-sdk/lib/python/snpe/converters/onnx/data_translations.py", line 467, in extract_parameters
params = extract_attributes
$ snpe-onnx-to-dlc --input_network xxx.onnx --output_path xxx.dlc --input_type "input" image --input_encoding "input" other --debug
2020-04-07 20:15:30,970 - 145 - DEBUG_1 - Added buffer named input of shape [1, 5, 256, 256]
2020-04-07 20:15:30,971 - 138 - DEBUG - DEBUG_CONVERTING_NODE: Attempting to convert node 0 with type Conv
2020-04-07 20:15:30,971 - 138 - DEBUG - DEBUG_RETRIEVE_WEIGHTS, key:
2020-04-07 20:15:30,971 - 138 - DEBUG - Added OpNode with name convolution_0, in_names ['input'], out_names ['886']
2020-04-07 20:15:30,971 - 145 - DEBUG_1 - Added buffer named 886 of shape [1, 3, 256, 256]
2020-04-07 20:15:30,971 - 138 - DEBUG - DEBUG_CONVERTING_NODE: Attempting to convert node 1 with type Constant
2020-04-07 20:15:30,971 - 174 - WARNING - WARNING_OP_VERSION_NOT_SUPPORTED: Operation Constant Not Supported. Expected operator version: [1], instead got version: [9]
2020-04-07 20:15:30,971 - 138 - DEBUG - Inserting weights for 887
2020-04-07 20:15:30,971 - 138 - DEBUG - Added OpNode with name 887, in_names [], out_names ['887']
2020-04-07 20:15:30,971 - 145 - DEBUG_1 - Added buffer named 887 of shape [1]
2020-04-07 20:15:30,971 - 138 - DEBUG - DEBUG_CONVERTING_NODE: Attempting to convert node 2 with type Constant
2020-04-07 20:15:30,972 - 174 - WARNING - WARNING_OP_VERSION_NOT_SUPPORTED: Operation Constant Not Supported. Expected operator version: [1], instead got version: [9]
2020-04-07 20:15:30,972 - 138 - DEBUG - Inserting weights for 888
2020-04-07 20:15:30,972 - 138 - DEBUG - Added OpNode with name 888, in_names [], out_names ['888']
2020-04-07 20:15:30,972 - 145 - DEBUG_1 - Added buffer named 888 of shape [1]
2020-04-07 20:15:30,972 - 138 - DEBUG - DEBUG_CONVERTING_NODE: Attempting to convert node 3 with type Constant
2020-04-07 20:15:30,972 - 174 - WARNING - WARNING_OP_VERSION_NOT_SUPPORTED: Operation Constant Not Supported. Expected operator version: [1], instead got version: [9]
2020-04-07 20:15:30,972 - 138 - DEBUG - Inserting weights for 889
2020-04-07 20:15:30,972 - 138 - DEBUG - Added OpNode with name 889, in_names [], out_names ['889']
2020-04-07 20:15:30,972 - 145 - DEBUG_1 - Added buffer named 889 of shape [1]
2020-04-07 20:15:30,972 - 138 - DEBUG - DEBUG_CONVERTING_NODE: Attempting to convert node 4 with type Constant
2020-04-07 20:15:30,972 - 174 - WARNING - WARNING_OP_VERSION_NOT_SUPPORTED: Operation Constant Not Supported. Expected operator version: [1], instead got version: [9]
2020-04-07 20:15:30,972 - 138 - DEBUG - Inserting weights for 890
2020-04-07 20:15:30,972 - 138 - DEBUG - Added OpNode with name 890, in_names [], out_names ['890']
2020-04-07 20:15:30,972 - 145 - DEBUG_1 - Added buffer named 890 of shape [1]
2020-04-07 20:15:30,972 - 138 - DEBUG - DEBUG_CONVERTING_NODE: Attempting to convert node 5 with type Slice
2020-04-07 20:15:30,972 - 164 - ERROR - Node : ERROR_ATTRIBUTE_MISSING: Node is missing required attribute starts
Hello odoetr33,
Did you end up figuring out the solution to this issue by any chance? I am trying to convert an ONNX model to DLC (onnx v1.3.0 (opset 11), Python 3.6.9, snpe-1.52.0.2724) and I am facing a similar error:
Traceback (most recent call last):
Hello,
As you can see from this link, ScaledTanh is removed from ONNX 1.4 onwards. Also you can refer below link for details on supported ONNX operations:
https://developer.qualcomm.com/docs/snpe/supported_onnx_ops.html#onnx_operator_support
Please provide more info on the model you are trying to convert so that I could try to reproduce the missing attribute error (starts/ends attribute of slice) on my system.