Opened 5 years ago

Closed 18 months ago

#59826 closed defect (wontfix)

py37-tensorflow 2.0.0 crashes with protobuf3

Reported by: essandess (Steve Smith) Owned by: emcrisostomo (Enrico Maria Crisostomo)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: Cc: cjones051073 (Chris Jones), someuser12, mascguy (Christopher Nielsen)
Port: py-tensorflow

Description

python3 -c 'import tensorflow'
[libprotobuf ERROR google/protobuf/descriptor_database.cc:394] Invalid file descriptor data passed to EncodedDescriptorDatabase::Add().
[libprotobuf FATAL google/protobuf/descriptor.cc:1359] 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): 
Abort trap: 6

Tried uninstall/reinstall of protobuf3-cpp, py37-protobuf3, py37-tensorflow, Xcode 11.2.1, all without success.

This is on macOS 10.14.

Attachments (2)

Portfile (2.7 KB) - added by someuser12 5 years ago.
Portfile for protobuf3.8-cpp (workaround is to downgrade protobuf3-cpp and py-protobuf3)
Portfile.2 (3.2 KB) - added by someuser12 5 years ago.
Portfile for py-protobuf3.8 (workaround is to downgrade protobuf3-cpp and py-protobuf3)

Download all attachments as: .zip

Change History (10)

comment:1 Changed 5 years ago by mf2k (Frank Schima)

Cc: emcrisostomo removed
Owner: set to emcrisostomo
Port: py-tensorflow added; py37-tensorflow removed
Status: newassigned

comment:2 Changed 5 years ago by cjones051073 (Chris Jones)

tensorflow uses bazel to build, which internally uses its own dependencies for everything.

to me this looks like an issue that should be punted upstream first, so please report to tensorflow devs and see what they have to say. It could be a macports specific issue, but given how bazel controls everything in the build (with vengeance) my first suspicion would be to start with that.

comment:3 Changed 5 years ago by essandess (Steve Smith)

This is a known issue for protobuf>3.10: https://github.com/tensorflow/tensorboard/issues/2985

The workaround is to use pip:

sudo port deactivate py37-protobuf3
sudo -EH pip-3.7 install protobuf==3.8

I'll ping upstream again.

comment:4 Changed 5 years ago by essandess (Steve Smith)

A pip install doesn't tickle this issue; therefore it's something to do with the MacPorts build.

comment:5 Changed 5 years ago by someuser12

Cc: someuser12 added

comment:6 in reply to:  3 Changed 5 years ago by someuser12

Replying to essandess:

The workaround is to use pip:

sudo port deactivate py37-protobuf3
sudo -EH pip-3.7 install protobuf==3.8

Thanks for pointing this.

Another workaround: downgrade the py-protobuf3 and protobuf3-cpp ports to version 3.8.0 (3.10.1 is not old enough; I did not test versions > 3.8.0 and < 3.10.1, maybe they are suitable).

Then, even if py-tensorflow1 wasn't rebuilt (which can save more than 15 hours of compilation on a Macbook Pro), python -c 'import tensorflow' doesn't crash anymore (tested on Mac OS 10.11 where py-tensorflow isn't available; based on the comments in the GitHub issue referenced above, my guess is that this workaround is also suitable for py-tensorflow).

I'll try to attach rough, custom portfiles for py-protobuf3 and protobuf3-cpp at version 3.8.0.

Changed 5 years ago by someuser12

Attachment: Portfile added

Portfile for protobuf3.8-cpp (workaround is to downgrade protobuf3-cpp and py-protobuf3)

Changed 5 years ago by someuser12

Attachment: Portfile.2 added

Portfile for py-protobuf3.8 (workaround is to downgrade protobuf3-cpp and py-protobuf3)

comment:7 Changed 18 months ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:8 Changed 18 months ago by mascguy (Christopher Nielsen)

Resolution: wontfix
Status: assignedclosed

Support for Python 3.7/3.8 has been dropped for py-tensorflow, so this ticket is no longer relevant. Closing.

Note: See TracTickets for help on using tickets.