-
Notifications
You must be signed in to change notification settings - Fork 64
undefined symbol: _ZNK6google8protobuf7Message13SpaceUsedLongEv #19
Comments
Hi @lcskrishna. Did you install using the binaries ( |
I have installed using source (pip install onnx) |
Please |
@lcskrishna Did you do pip inside a conda virtual environment? |
@bddppq No, I don't have conda virtual environment setup, I'm trying directly using pip install. |
@lcskrishna I see. Which OS are you using? Could you do |
I am using Ubuntu 16.04 Here are the outputs you asked for: %ldd /home/chaitanya/.local/lib/python2.7/site-packages/onnx/onnx_cpp2py_export.so
%readelf -d /home/chaitanya/.local/lib/python2.7/site-packages/onnx/onnx_cpp2py_export.so
% echo $LD_LIBRARY_PATH
|
@lcskrishna Hmm...everything looks normal to me. Could you also do |
I am getting the following output :
|
@lcskrishna Not sure whether it's your protobuf installation being broken. Adding "-D" flag to the nm command might help debugging. In the meanwhile, since you are using ubuntu, could you use "sudo apt-get install libprotobuf-dev protobuf-compiler" to install protobuf? |
@lcskrishna Have you been able to resolve the issue? |
I tried a fresh installation of caffe2, protobuf, onnx and onnx-caffe2
Here is my script:
|
@lcskrishna What's the size of your pb file? I suspect it's hitting the 64mb limit. Could you try 'export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python' in your terminal and then run your code snippet again? |
@bddppq the size of the file is around 4mb and i forgot to export. I took a caffemodel of CIFAR10 and using the conversion tool in caffe2 and translated into caffe2 model and tried to perform conversion as mentioned above, still i get the following error.
|
@lcskrishna Please add option --remove_legacy_pad when you do the translation from caffe model to caffe2 model. |
@jerryzh168 Traceback (most recent call last): |
@lcskrishna could you post your caffe1 model? I'll try to modify caffe_translator to make sure it works with your model. |
@jerryzh168 |
Can you post the deploy.prototxt as well? Thanks |
Here is my prototxt file used. |
@lcskrishna did you update your build to the most recent caffe2? I can translate your model actually. Since a more recent update don't remove legacy pad by default. As a side note, there was an problem in _GetLegacyDims(should use feed rather than feed_blob), and it will be fixed after my new diff lands. |
@jerryzh168 I tried it again and im still getting the same issue. Can you post the command on how you were executing the translator. Thanks. |
I see, since you need to use remove_legacy_pad, that code will be called. Please wait until my diff landed. Also you should probably provide input_dim by add "--input_dims" option after that diff is landed. |
@lcskrishna The diff is landed, please update your c2 and try again. |
@jerryzh168 I tried the following after updating caffe2 and I get the following error. Command:
Error
|
@lcskrishna is this a train net? Probably you should use "deploy_net" instead. |
Hi, I encountered a similar problem when I try to import onnx using python on Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-135-generic x86_64). $ python -c 'import onnx'
$ ldd /usr/local/lib/python2.7/dist-packages/onnx/onnx_cpp2py_export.so
$ readelf -d /usr/local/lib/python2.7/dist-packages/onnx/onnx_cpp2py_export.so
$ echo $LD_LIBRARY_PATH $ nm -C /usr/lib/x86_64-linux-gnu/libprotobuf.so.8 | grep SpaceUsedLong $ nm -C -D /usr/lib/x86_64-linux-gnu/libprotobuf.so.8 | grep SpaceUsedLong I did "sudo apt-get install libprotobuf-dev protobuf-compiler" but found the protoc version is too low (2.5.0-9ubuntu1) for onnx (as suggested by this issue). So I manually installed a newer version of protoc (version 3.5.1). |
This is still an issue. I just build caffe (which is now a part of pytorch) and I am getting the same error: One thing I found is that before (when everything was still working), |
yeah protobuf version need to match, I think we are using 2.6, cc @bddppq |
How to solve this then, if caffe is using a different version? I tried building caffe with BUILD_CUSTOM_PROTOBUF=OFF, forcing it to use the 2.6.1 protobuf that was installed already - causes it to fail on runtime, when running inference with an ONNX model. |
I created a Docker to reproduce the error. You can either build it yourself with this file, or download the image via Then just run it with
which will throw the above mentioned ImportError. Hope this helps to understand/fix the problem. |
@bddppq @houseroad could you take a look? |
@michaelschwier could you try to add |
@houseroad Unfortunately it didn't. Actually no matter in which order I run the three imports
I will always get the same error. I think this has something to do with Caffe2 building it's own version of protobuf which is not compatible with ONNX!? |
I installed onnx with conda, having the same ERROR |
conda install -c conda-forge onnx conda install -c ezyang onnx have the same error |
I am trying to use this tool for converting a caffe2 model to onnx model using the example given #3
I am trying to convert resnet-101 model.
Below is my error log:
can someone help me out with the above issue.
The text was updated successfully, but these errors were encountered: