onnx: Import error with onnx-1.7.0 in mac os catalina
Hi I get the following error when I import onnx (python 3.7.7)
[libprotobuf ERROR google/protobuf/descriptor_database.cc:394] Invalid file descriptor data passed to EncodedDescriptorDatabase::Add().
[libprotobuf FATAL google/protobuf/descriptor.cc:1356] CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
libc++abi.dylib: terminating with uncaught exception of type google::protobuf::FatalException: CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
with onnx-1.6.0 no import errors
I tried changing version of protobuf using either
pip install protobuf==3.8.0
pip install protobuf==3.12.2
and
brew reinstall protobuf
didn’t help
Any Ideas? I have been trinying to fix this all day
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 24 (13 by maintainers)
I’ve also faced this problem on my mac with
onnx==1.7.0,protobuf==3.12.2, Python 3.7.7 on Max OSX Catalina 10.15.5.It went away when I downgraded to
onnx==1.6.0, not sure why.Thank you for providing the info. I can repro this now. There are 3 possible ways to workaround this:
import onnxbeforeimport tensorflowI have 2 questions:
import tensorflowfirst thenimport onnx. Did you encounter this error in other scenarios?Thank you for bringing this up again to remind that this issue is still not resolved.
I finally got it to work! For one reason or another, everything works fine in a conda environment (I was using a Virtualenv environment before).
If installed in this order:
everything works as it should.
Hi @jcwchen,
Thanks