{"action":"created","issue":{"url":"https://api.github.com/repos/dmlc/mxnet/issues/4065","repository_url":"https://api.github.com/repos/dmlc/mxnet","labels_url":"https://api.github.com/repos/dmlc/mxnet/issues/4065/labels{/name}","comments_url":"https://api.github.com/repos/dmlc/mxnet/issues/4065/comments","events_url":"https://api.github.com/repos/dmlc/mxnet/issues/4065/events","html_url":"https://github.com/dmlc/mxnet/issues/4065","id":193050483,"number":4065,"title":"Is there a conflict between anaconda and mxnet?","user":{"login":"dreamquster","id":4962716,"avatar_url":"https://avatars.githubusercontent.com/u/4962716?v=3","gravatar_id":"","url":"https://api.github.com/users/dreamquster","html_url":"https://github.com/dreamquster","followers_url":"https://api.github.com/users/dreamquster/followers","following_url":"https://api.github.com/users/dreamquster/following{/other_user}","gists_url":"https://api.github.com/users/dreamquster/gists{/gist_id}","starred_url":"https://api.github.com/users/dreamquster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dreamquster/subscriptions","organizations_url":"https://api.github.com/users/dreamquster/orgs","repos_url":"https://api.github.com/users/dreamquster/repos","events_url":"https://api.github.com/users/dreamquster/events{/privacy}","received_events_url":"https://api.github.com/users/dreamquster/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-02T07:19:35Z","updated_at":"2016-12-14T09:22:25Z","closed_at":null,"body":"I had installed anaconda2(python2.7) in Ubuntu16.04. Then, I compile and installe mxnet. But when I use anaconda python interpret execute scripts such as:\r\n```python\r\nimport mxnet as mx\r\n```\r\nI get the following errors\r\n```python\r\n  File \"/home/dknight/softwares/pycharm-community-2016.3/helpers/pydev/pydevd.py\", line 1596, in <module>\r\n    globals = debugger.run(setup['file'], None, None, is_module)\r\n  File \"/home/dknight/softwares/pycharm-community-2016.3/helpers/pydev/pydevd.py\", line 974, in run\r\n    pydev_imports.execfile(file, globals, locals)  # execute the script\r\n  File \"/home/dknight/PycharmProjects/mxnet-learn/mxnet-digit-recognize.py\", line 40, in <module>\r\n    import mxnet as mx\r\n  File \"/home/dknight/OpenSource/Github/mxnet/python/mxnet/__init__.py\", line 7, in <module>\r\n    from .base import MXNetError\r\n  File \"/home/dknight/OpenSource/Github/mxnet/python/mxnet/base.py\", line 43, in <module>\r\n    _LIB = _load_lib()\r\n  File \"/home/dknight/OpenSource/Github/mxnet/python/mxnet/base.py\", line 35, in _load_lib\r\n    lib = ctypes.cdll.LoadLibrary(lib_path[0])\r\n  File \"/home/dknight/anaconda2/lib/python2.7/ctypes/__init__.py\", line 440, in LoadLibrary\r\n    return self._dlltype(name)\r\n  File \"/home/dknight/anaconda2/lib/python2.7/ctypes/__init__.py\", line 362, in __init__\r\n    self._handle = _dlopen(self._name, mode)\r\nOSError: /home/dknight/anaconda2/bin/../lib/libgomp.so.1: version `GOMP_4.0' not found (required by /home/dknight/OpenSource/Github/mxnet/python/mxnet/../../lib/libmxnet.so)\r\n```\r\nWith the help of `locate libgomp.so`, I found multiple the same name library.  Is there a conflict between anaconda and mxnet?\r\n```shell\r\npython git:(master) ✗ locate libgomp.so\r\n/home/dknight/anaconda2/lib/libgomp.so\r\n/home/dknight/anaconda2/lib/libgomp.so.1\r\n/home/dknight/anaconda2/lib/libgomp.so.1.0.0\r\n/home/dknight/anaconda2/pkgs/libgcc-4.8.5-2/lib/libgomp.so\r\n/home/dknight/anaconda2/pkgs/libgcc-4.8.5-2/lib/libgomp.so.1\r\n/home/dknight/anaconda2/pkgs/libgcc-4.8.5-2/lib/libgomp.so.1.0.0\r\n/usr/lib/gcc/x86_64-linux-gnu/5/libgomp.so\r\n/usr/lib/x86_64-linux-gnu/libgomp.so.1\r\n/usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/dmlc/mxnet/issues/comments/266984251","html_url":"https://github.com/dmlc/mxnet/issues/4065#issuecomment-266984251","issue_url":"https://api.github.com/repos/dmlc/mxnet/issues/4065","id":266984251,"user":{"login":"RamonYeung","id":9263603,"avatar_url":"https://avatars.githubusercontent.com/u/9263603?v=3","gravatar_id":"","url":"https://api.github.com/users/RamonYeung","html_url":"https://github.com/RamonYeung","followers_url":"https://api.github.com/users/RamonYeung/followers","following_url":"https://api.github.com/users/RamonYeung/following{/other_user}","gists_url":"https://api.github.com/users/RamonYeung/gists{/gist_id}","starred_url":"https://api.github.com/users/RamonYeung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RamonYeung/subscriptions","organizations_url":"https://api.github.com/users/RamonYeung/orgs","repos_url":"https://api.github.com/users/RamonYeung/repos","events_url":"https://api.github.com/users/RamonYeung/events{/privacy}","received_events_url":"https://api.github.com/users/RamonYeung/received_events","type":"User","site_admin":false},"created_at":"2016-12-14T09:22:25Z","updated_at":"2016-12-14T09:22:25Z","body":"I encounted the same error while trying to build MXnet on Anaconda.\r\n\r\n### 1st try\r\nI followed this [blog post](http://guanghan.info/blog/en/my-works/building-our-personal-deep-learning-rig-gtx-1080-ubuntu-16-04-cuda-8-0rc-cudnn-7-tensorflowmxnetcaffedarknet/) to solve the problem by using virtual env feature@conda.\r\n\r\n```\r\n# Create a virtual environment for Mxnet\r\nconda create -n mxnet python=2.7\r\nsource activate mxnet\r\n\r\nsudo apt-get update\r\nsudo apt-get install -y build-essential git libatlas-base-dev libopencv-dev\r\ngit clone –recursive https://github.com/dmlc/mxnet\r\nedit make/config.mk\r\nset cuda= 1, set cudnn= 1, add cuda path\r\n\r\ncd mxnet\r\nmake clean_all\r\nmake -j8 # num of CPU cores\r\nconda install -c anaconda numpy=1.11.1\r\ncp -r ../mxnet/python/mxnet .\r\ncp ../mxnet/lib/libmxnet.so mxnet/\r\n\r\n# Quick Test\r\npython example/image-classification/train_mnist.py\r\n```\r\nI was able to run `example/image-classification/train_mnist.py` \r\n\r\nSince virtual env means a seperate environment from the root one, any other pkgs can not be used before installed(linked). \r\n\r\n**And then wired part.** I used `conda install -n mxnet anaconda` to install all the rest pkgs. \r\nI run the train_mnist.py as soon as it finished, and OSError occurs!\r\n \r\n### 2nd try \r\nAnaconda [says](https://www.continuum.io/blog/developer-blog/anaconda-25-release-now-mkl-optimizations) they have included the Intel Math Kernel Library (MKL) optimizations (version 11.3.1) for improved performance.\r\n\r\nAs @piiswrong mentioned, I found a [file]( https://github.com/dmlc/mxnet/blob/092ff447ceb6ed92c5e8cdf591cf0797e0b8c7a0/MKL_README.md) related both `LD_LIBRARY_PATH` and `MKL`.\r\n\r\n```\r\nconda install nomkl numpy scipy scikit-learn numexpr\r\nconda remove mkl mkl-service\r\n```\r\nor set USE_OPENMP=0 in mxnet/config.mk do not help, at least in my case.\r\n\r\n### Conclusion\r\n1st try can solve the problem, any other pkg you need can be linked from Anaconda root env(if installed).\r\nI believe problem occurs when mxnet is trying to link a system/local lib named `libgomp.so` which customized by Anaconda."}}
{"actor":{"display_login":"RamonYeung"}}