question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import error with onnx-1.7.0 in mac os catalina

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:24 (13 by maintainers)

github_iconTop GitHub Comments

8reactions
yoavzcommented, Jul 11, 2020

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.

3reactions
jcwchencommented, Jan 15, 2021

Thank you for providing the info. I can repro this now. There are 3 possible ways to workaround this:

  1. Like you mentioned, downgrade the protobuf version.
  2. Use ONNX 1.6.0.
  3. import onnx before import tensorflow

I have 2 questions:

  1. How could you use protobuf==3.4.0 with the latest tensorflow? (I saw it has a requirement: tensorflow 2.4.0 requires protobuf>=3.9.2)
  2. I thought it only happens when import tensorflow first then import 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

About incompatible media in iMovie for macOS
When you import media or open a library in iMovie 10.1.11 or later on a Mac with macOS Mojave, a window appears that...
Read more >
Installing PowerShell on macOS
Information about installing PowerShell on macOS.
Read more >
Mac - Python - import error: "No module named site"
I can open IDLE and type 8+8 and I get 16 just fine. Here is the error I am getting in terminal: host-210-117:~...
Read more >
How to Fix “Import Failed” Mail Error on Mac
Open the latest V# folder (V8, V5, V6, V7, etc) and then do either of the following, depending on the situation: If the...
Read more >
Known issues in Lightroom
When you try to import an AVI video file, Lightroom displays an import error. (Operating system: macOS only). Beginning with the October 2018 ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found