You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2017/11/07 06:47:14 UTC

[GitHub] wkcn opened a new issue #8569: The conflict between MXNet and OpenCV

wkcn opened a new issue #8569: The conflict between MXNet and OpenCV
URL: https://github.com/apache/incubator-mxnet/issues/8569
 
 
   Hi, there.
   
   I found the reason of the conflict between MXNet and OpenCV.
   
   ## Environment info
   Operation System: Arch Linux 4.13.6
   MXNet: 3f37577 (Date:   Tue Nov 7 02:13:07 2017 +0800)
   OpenCV: 3.3.1
   Python: 2.7.14/3.6.3
   GCC: 6.3.1 20170109
   Build config: `make -j $(nproc) USE_OPENCV=1 USE_BLAS=openblas`
   
   ## Steps to reproduce
   1. I built the MXNet core shared library with `make -j $(nproc) USE_OPENCV=1 USE_BLAS=openblas`
   `make/config.mk` is default.
   The building was successful. 
   2. Then I was going to install the MXNet Python binding.
   ```bash
   	cd python
   	sudo python setup.py install
   ```
   
   It showed the error that:
   
   `*** Error in python': free(): invalid pointer:0x000055ec46fe1520 *** `
   
   ## What I have tried to solve it
   I deleted all `"import cv2"` in `$(MXNET_PATH)/python/mxnet/{recordio.py, image/{detection.py, image.py}}`
   
   Then I made two tests in the folder `$(MXNET_PATH)/python/`.
   
   ```bash
   ?  python git:(master) ? python 
   Python 3.6.3 (default, Oct 24 2017, 14:48:20) 
   [GCC 7.2.0] on linux
   Type "help", "copyright", "credits" or "license" for more information.
   >>> import mxnet
   >>> import cv2
   *** Error in `python': free(): invalid pointer: 0x0000564c7470d520 ***
   [1]    116917 abort (core dumped)  python
   
   ?  python git:(master) ? python
   Python 3.6.3 (default, Oct 24 2017, 14:48:20) 
   [GCC 7.2.0] on linux
   Type "help", "copyright", "credits" or "license" for more information.
   >>> import cv2
   >>> import mxnet
   [src/tcmalloc.cc:283] Attempt to free invalid pointer 0x5568689f8fc0 
   [1]    116946 abort (core dumped)  python
   ```
   
   `src/tcmalloc.cc` is the code of **gperftools**.
   So I think there is a conflict between `gperftools` and `opencv2`.
   
   I set `USE_GPERFTOOLS = 0` and `USE_JEMALLOC = 0` in `$(MXNET_PATH)/make/config.mk`, and rebuild MXNet.
   The problem is solved.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services