onnx: Undefined Symbol
I’m trying to build ONNX, I have tried several times. I have a Conda distribution, Python 3. I have installed protobuf using Conda (no system protobuf installed). OS: Ubuntu 16.04 ONNX builds fine, but when I try to import it I get the following:
>>> import onnx Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/ww/anaconda3/lib/python3.6/site-packages/onnx-1.1.1-py3.6-linux-x86_64.egg/onnx/__init__.py", line 10, in <module> import onnx.helper # noqa File "/home/ww/anaconda3/lib/python3.6/site-packages/onnx-1.1.1-py3.6-linux-x86_64.egg/onnx/helper.py", line 14, in <module> import onnx.defs as defs File "/home/ww/anaconda3/lib/python3.6/site-packages/onnx-1.1.1-py3.6-linux-x86_64.egg/onnx/defs/__init__.py", line 7, in <module> import onnx.onnx_cpp2py_export.defs as C # type: ignore ImportError: /home/ww/anaconda3/lib/python3.6/site-packages/onnx-1.1.1-py3.6-linux-x86_64.egg/onnx/onnx_cpp2py_export.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZNK6google8protobuf7Message11GetTypeNameB5cxx11Ev
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 6
- Comments: 22 (5 by maintainers)
@guoyejun I repeated what you suggested and got: ImportError: /home/ruoyan01/anaconda2/lib/python2.7/site-packages/onnx/onnx_cpp2py_export.so: undefined symbol: _ZNK6google8protobuf7Message11GetTypeNameB5cxx11Ev
No idea why. Can we build onnx from source using anaconda dependencies at all?
It helped when i made sure that protobuf was installed before onnx, which is mentioned in the README.md
i also met this issue with ‘conda install -c conda-forge protobuf numpy’, and the issue is gone with ‘conda install protobuf numpy’, there is no error to run ‘python setup.py install’.