-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
opencv_dnn produce errors when a thirdparty also links against protobuf #823
Comments
Can you please check whether the problem persists with the latest OpenCV version? Can you provide reproducing example in Python or C++? |
@agilmor, there are modules in contrib, which try to use system protobuf and load caffe.proto: dnn_modern and cnn_3dobj. But dnn module builds its own version of protobuf, so there shouldn't be any conflicts with system protobuf. Try to disable dnn_modern and cnn_3dobj modules in your build (-DBUILD_opencv_cnn_3dobj=OFF -DBUILD_opencv_dnn_modern=OFF as options for cmake) and please let me know about results |
@agilmor , also the latest Caffe changes might help, BVLC/caffe#5624. |
In NixOS we also run into the same @dkurt I tried building with the latest caffe which includes the |
@basvandijk, we're going to avoid protobuf dependency by own parser, #1291 + opencv/opencv#9106. You may try it if you want to use DNN module. |
Release notes: https://opencv.org/opencv-3-3.html The contrib module cnn_3dobj is disabled because it fails to build. The contrib module dnn_modern is disabled because it causes: opencv/opencv_contrib#823
Release notes: https://opencv.org/opencv-3-3.html The contrib module cnn_3dobj is disabled because it fails to build. The contrib module dnn_modern is disabled because it causes: opencv/opencv_contrib#823
Migrate here: opencv/opencv#7425 |
Third-party library liking opencv compile with the dnn module might link a different protobuf shared library which makes it unusable as protobuf cannot operate from two shared libs concurrently. opencv/opencv_contrib#823
Release notes: https://opencv.org/opencv-3-3.html The contrib module cnn_3dobj is disabled because it fails to build. The contrib module dnn_modern is disabled because it causes: opencv/opencv_contrib#823
System information (version)
Detailed description
When using OpenCV DNN with Caffe, both linking against Protobuf the following error apears:
And then a
std::terminate
is thrown by protobuf.Some people reported that its a problem with dynamic linking against Protobuf, but in my experience it also happen using static linking.
I'm not sure if the problem is in OpenCV, in Protobuf, or in Caffe.
But the current workaround is disable OpenCV DNN.
Is the problem really there, in opencv_dnn? Can we solve it?
Steps to reproduce
Build OpenCV with DNN.
Build Caffe with pycaffe or matcaffe.
In caffe, just run something like:
And you will get the
std::terminate
.Similar commands with pycaffe also reproduce this error.
Thanks!
PS: This comes from opencv/opencv#7425
The text was updated successfully, but these errors were encountered: