Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 682212 - sci-libs/tensorflow-1.13.0_rc2 with media-libs/opencv-3.4.1-r5 - python module conflicts over "tensorflow.AttrValue" protobuf symbol
Summary: sci-libs/tensorflow-1.13.0_rc2 with media-libs/opencv-3.4.1-r5 - python modul...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Amy Liffey
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-01 08:53 UTC by Michael Moon
Modified: 2019-10-04 11:10 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Rename tensorflow namespace patch (cvproto.patch,4.51 KB, patch)
2019-09-25 11:30 UTC, Jason Zaman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Moon 2019-04-01 08:53:23 UTC
$ python
Python 3.5.5 (default, Apr 24 2018, 21:05:32) 
[GCC 6.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
>>> import cv2
[libprotobuf ERROR /var/tmp/portage/dev-libs/protobuf-3.6.1.3/work/protobuf-3.6.1.3/src/google/protobuf/descriptor_database.cc:111] Symbol name "tensorflow.AttrValue" conflicts with the existing symbol "tensorflow.AttrValue".
[libprotobuf FATAL /var/tmp/portage/dev-libs/protobuf-3.6.1.3/work/protobuf-3.6.1.3/src/google/protobuf/descriptor.cc:1358] CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size): 
terminate called after throwing an instance of 'google::protobuf::FatalException'
what():  CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size): 
Aborted

(same results in python2.7 and python3.6)

While I could find very little info on google that seemed pertinent, https://stackoverflow.com/questions/51795326/static-linking-of-protocol-buffers-results-in-conflicts-with-existing-symbols?rq=1 may be relevant, and https://github.com/tensorflow/tensorflow/issues/9525 might be tangentially related.
Comment 1 Amy Liffey gentoo-dev 2019-04-01 17:32:42 UTC
This https://github.com/tensorflow/tensorflow/pull/19966 seems relevant.
Comment 2 Peter Serbe 2019-05-13 11:35:26 UTC
same here. No changes for tensorflow-1.13.1. I've tested protobuf-3.7.1 and 3.6.1.3: no difference between them. That patch, mentioned by Amy Liffey is present (at least in ./tensorflow/BUILD) - but something's going on behind the scenes. :-(

HOME\peter@hydra ~/PreyBlocker/Main/TrainAndTest_01 $ ./test.py
[libprotobuf ERROR /var/tmp/portage/dev-libs/protobuf-3.7.1/work/protobuf-3.7.1/src/google/protobuf/descriptor_database.cc:111] Symbol name "tensorflow.TensorShapeProto" conflicts with the existing symbol "tensorflow.TensorShapeProto".
[libprotobuf FATAL /var/tmp/portage/dev-libs/protobuf-3.7.1/work/protobuf-3.7.1/src/google/protobuf/descriptor.cc:1370] CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
terminate called after throwing an instance of 'google::protobuf::FatalException'
  what():  CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
Aborted
Comment 3 Jason Zaman gentoo-dev 2019-09-25 11:30:45 UTC
Created attachment 591018 [details, diff]
Rename tensorflow namespace patch

I found the fix finally: 
https://github.com/opencv/opencv/pull/10092
https://github.com/opencv/opencv/commit/cb5da8983f911002ba8a316695c634111a62d274
Applying that commit to opencv fixes it for me. The fix is in opencv-3.4.4, so best is just to bump the package, there are several new versions that are not yet in the tree.

The patch does not apply as-is, ive attached the fixed patched which works when put in epatch_user
Comment 4 Michael Moon 2019-10-04 11:10:46 UTC
Works for me, thanks!