Following instructions I successfully installed onnx --> python -c "import onnx" doesn't complain. I brought in the source and built it that way.
Now I try an onnx to dlc conversion - I'm currently getting: (same result without --debug and -d arguments)
~/repos/onnx$ snpe-onnx-to-dlc --m /home/sbace/ace/onnx1/mns-Ox.onnx --debug -d .
Traceback (most recent call last):
File "/home/sbace/repos/snpe-1.25.1.310/bin/x86_64-linux-clang/snpe-onnx-to-dlc", line 15, in <module>
converter = onnx_converter.OnnxConverter()
File "/home/sbace/repos/snpe-1.25.1.310/lib/python/snpe/converters/onnx/onnx_to_dlc.py", line 61, in __init__
self.op_info = onnx_translations.OpVersionInfo()
File "/home/sbace/repos/snpe-1.25.1.310/lib/python/snpe/converters/onnx/onnx_translations.py", line 123, in __init__
self.setup_op_version_dict()
File "/home/sbace/repos/snpe-1.25.1.310/lib/python/snpe/converters/onnx/onnx_translations.py", line 126, in setup_op_version_dict
for schema in defs.get_all_schemas_with_history():
NameError: global name 'defs' is not defined
However, in "Environment Setup for ONNX", I'm not sure where the "ONNX directory" location is. I've tried both the top level git folder and the onnx subfolder.
Further clue - if I try to run snpe-onnx-to-dlc from anywhere other than the top level git folder, I get a segmentation fault. At least there it responds to -h and the above failure.
This happens when `from onnx import defs` is not called in lib/python/snpe/converters/onnx/util.py line:16
meaning that onnx is not installed properly when used with snpe
the snpe-onnx-to-dlc script uses
#!/usr/bin/env python
so check:
$ env python -c "import onnx, snpe"
Running this line caused:
- Segmentation Fault, if wrong python versions are used (onnx in virtualenv)
- "ImportError: No module named onnx", if python path is wrong
I tried with python2.7 and onnx==1.2.1 and protobuf==3.8.0. They work with the latest snpe1.27.1.
Kindly try with the latest NPE SDK, this issue has been resolved.
You can download the latest SDK from here and guidelines for the setting up the SDK are here