snpe version:1.64.0.3605
when I used snpe-onnx-to-dlc, error occur:NameError: name 'graph' is not defined
Traceback (most recent call last):
File "/xxx/snpe/snpe-1.64.0.3605/lib/python/qti/aisw/converters/onnx/onnx_to_ir.py", line 282, in convert
self.converter_context)
File "/xxx/snpe/snpe-1.64.0.3605/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 "/xxx/snpe/snpe-1.64.0.3605/lib/python/qti/aisw/converters/common/converter_ir/translation.py", line 18, in apply_method
return self.indexed_methods[method_name](*args, **kwargs)
File "/xxx/snpe/snpe-1.64.0.3605/lib/python/qti/aisw/converters/common/converter_ir/translation.py", line 123, in add_op
op = self.extract_parameters(src_op, context)
File "/xxx/snpe/snpe-1.64.0.3605/lib/python/qti/aisw/converters/onnx/math_translations.py", line 396, in extract_parameters
if not graph.has_buffer(src_op.input[0]):
NameError: name 'graph' is not defined
2022-08-12 16:13:02,043 - 209 - ERROR - Node Identity_0: name 'graph' is not defined
I check the code in onnx/math_translations.py, I found:
def extract_parameters(self, src_op, converter_context):
# if the input buffer is not in the graph, that means
# it is a const input. We replace all const inputs with a
# const op. Otherwise the identity op is a no-op that
# gets squashed later.
if not graph.has_buffer(src_op.input[0]):
const_input = converter_context.weights.fetch(str(src_op.input[0]))
converter_context.weights.insert(str(src_op.output[0]), const_input)
return op_adapter.ConstantOp(src_op.output[0], const_input)
return op_adapter.NoopOp(str(src_op.name))
"graph" not defined!
hi, can you please share the full command you are using?