Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

OpenCV 4.0 Compatibility #13288

Open
szha opened this issue Nov 15, 2018 · 5 comments
Open

OpenCV 4.0 Compatibility #13288

szha opened this issue Nov 15, 2018 · 5 comments
Labels

Comments

@szha
Copy link
Member

szha commented Nov 15, 2018

OpenCV 4 is happening soon https://github.com/opencv/opencv/wiki/ChangeLog#version400. The big changes include the switch to C++11 and API changes.

If you have experience trying it out with MXNet, please do share your findings here. Thank you.

@zachgk
Copy link
Contributor

zachgk commented Nov 16, 2018

@mxnet-label-bot add [Build, OpenCV]

Thank you for submitting the issue! I'm labeling it so the MXNet community members can help resolve it.

@marcoabreu marcoabreu added Build OpenCV OpenCV related issues labels Nov 16, 2018
@piyushghai
Copy link
Contributor

Related PR got merged : #14313

@szha Is this issue good to close now ?

@szha
Copy link
Member Author

szha commented Mar 7, 2019

Yes, thanks for the fix @daleydeng and @wkcn

@szha szha closed this as completed Mar 7, 2019
@ziyuang
Copy link

ziyuang commented Apr 2, 2019

I still have linking errors in creating bin/im2rec with OpenCV 4.0.1 (MXNet HEAD: 09ba8be), mostly from not able to find cv::String::allocate, cv::String::deallocate, and cv::error. OpenCV 4 has moved to std::string so there are no methods of allocate or deallocate.

(cd cpp-package/scripts; python OpWrapperGenerator.py mxnet/lib/libmxnet.so)
g++ -o bin/im2rec ... -L/usr/local/lib -lopencv_imgcodecs -lopencv_highgui -lopencv_imgproc -lopencv_core
Traceback (most recent call last):
  File "OpWrapperGenerator.py", line 432, in <module>
    raise(e)
  File "OpWrapperGenerator.py", line 426, in <module>
    f.write(patternStr % ParseAllOps())
  File "OpWrapperGenerator.py", line 320, in ParseAllOps
    cdll.libmxnet = cdll.LoadLibrary(sys.argv[1])
  File "~/anaconda3/lib/python3.6/ctypes/__init__.py", line 426, in LoadLibrary
    return self._dlltype(name)
  File "~/anaconda3/lib/python3.6/ctypes/__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: mxnet/lib/libmxnet.so: undefined symbol: _ZN2cv6String8allocateEm
cpp-package/cpp-package.mk:39: recipe for target 'cpp-package/include/mxnet-cpp/op.h' failed
make: *** [cpp-package/include/mxnet-cpp/op.h] Error 1
...

The OpenCV 4 libraries have been installed to /usr/local/lib.

@szha szha reopened this Apr 2, 2019
@rajkinra23
Copy link

I still have linking errors in creating bin/im2rec with OpenCV 4.0.1 (MXNet HEAD: 09ba8be), mostly from not able to find cv::String::allocate, cv::String::deallocate, and cv::error. OpenCV 4 has moved to std::string so there are no methods of allocate or deallocate.

(cd cpp-package/scripts; python OpWrapperGenerator.py mxnet/lib/libmxnet.so)
g++ -o bin/im2rec ... -L/usr/local/lib -lopencv_imgcodecs -lopencv_highgui -lopencv_imgproc -lopencv_core
Traceback (most recent call last):
  File "OpWrapperGenerator.py", line 432, in <module>
    raise(e)
  File "OpWrapperGenerator.py", line 426, in <module>
    f.write(patternStr % ParseAllOps())
  File "OpWrapperGenerator.py", line 320, in ParseAllOps
    cdll.libmxnet = cdll.LoadLibrary(sys.argv[1])
  File "~/anaconda3/lib/python3.6/ctypes/__init__.py", line 426, in LoadLibrary
    return self._dlltype(name)
  File "~/anaconda3/lib/python3.6/ctypes/__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: mxnet/lib/libmxnet.so: undefined symbol: _ZN2cv6String8allocateEm
cpp-package/cpp-package.mk:39: recipe for target 'cpp-package/include/mxnet-cpp/op.h' failed
make: *** [cpp-package/include/mxnet-cpp/op.h] Error 1
...

The OpenCV 4 libraries have been installed to /usr/local/lib.

+1, im having the exact same problem here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants