mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

[kvstore] kvstore.cc:41: compile with USE_DIST_KVSTORE=1 to use dist_async

Open qiaohaijun opened this issue 11 years ago • 11 comments

mxnet.base.MXNetError: [01:53:19] /search/data/github/dmlc/mxnet/src/kvstore/kvstore.cc:41: compile with USE_DIST_KVSTORE=1 to use dist_async Traceback (most recent call last): File "train_cifar10.py", line 1, in import find_mxnet File "/search/data/user/qhj/github/mxnet/example/image-classification/find_mxnet.py", line 2, in import mxnet as mx File "/usr/lib/python2.7/site-packages/mxnet-0.5.0-py2.7.egg/mxnet/init.py", line 34, in from . import kvstore_server File "/usr/lib/python2.7/site-packages/mxnet-0.5.0-py2.7.egg/mxnet/kvstore_server.py", line 59, in _init_kvstore_server_module() File "/usr/lib/python2.7/site-packages/mxnet-0.5.0-py2.7.egg/mxnet/kvstore_server.py", line 54, in _init_kvstore_server_module kvstore = create('dist') File "/usr/lib/python2.7/site-packages/mxnet-0.5.0-py2.7.egg/mxnet/kvstore.py", line 378, in create ctypes.byref(handle))) File "/usr/lib/python2.7/site-packages/mxnet-0.5.0-py2.7.egg/mxnet/base.py", line 73, in check_call raise MXNetError(py_str(_LIB.MXGetLastError())) mxnet.base.MXNetError: [01:53:19] /search/data/github/dmlc/mxnet/src/kvstore/kvstore.cc:41: compile with USE_DIST_KVSTORE=1 to use dist Exception in thread Thread-3:

qiaohaijun avatar Nov 25 '15 17:11 qiaohaijun

I have change the config.mk

USE_DIST_KVSTORE = 1

what the problem ?

qiaohaijun avatar Nov 25 '15 17:11 qiaohaijun

please make clean_all first

mli avatar Nov 25 '15 19:11 mli

I will try "make clean_all"

qiaohaijun avatar Nov 26 '15 01:11 qiaohaijun

I make a mistake I complie mxnet on a machine,and use command rsync to the cluster, after I execute "cd python; python setup install", problem solved.

PS: please close the issue, it's a mistake

qiaohaijun avatar Nov 26 '15 04:11 qiaohaijun

i generally do not suggest to use python setup install since we update the codes frequently, especially for distributed training. a better way is just copy the .so and files, see the instruction above

https://github.com/dmlc/mxnet/tree/master/example/image-classification#predict

mli avatar Nov 26 '15 04:11 mli

thx @mli I will use the way you recommend

qiaohaijun avatar Nov 26 '15 06:11 qiaohaijun

I have change the config.mk USE_DIST_KVSTORE = 1,and make clean_all, and then make. However the problem is still like this. @mli

root@sparkMachine1:/mxnet# tools/launch.py -n 2 -H hosts python example/image-classification/train_mnist.py --kv-store dist_sync
libdc1394 error: Failed to initialize libdc1394
OpenCV is unavailable.
[17:13:44] ./dmlc-core/include/dmlc/logging.h:208: [17:13:44] src/kvstore/kvstore.cc:41: compile with USE_DIST_KVSTORE=1 to use dist
Traceback (most recent call last):
File "example/image-classification/train_mnist.py", line 1, in <module>
import find_mxnet
File "/mxnet/example/image-classification/find_mxnet.py", line 2, in <module>
import mxnet as mx
File "/usr/local/lib/python2.7/dist-packages/mxnet-0.5.0-py2.7.egg/mxnet/__init__.py", line 35, in <module>
from . import kvstore_server
File "/usr/local/lib/python2.7/dist-packages/mxnet-0.5.0-py2.7.egg/mxnet/kvstore_server.py", line 68, in <module>
_init_kvstore_server_module()
File "/usr/local/lib/python2.7/dist-packages/mxnet-0.5.0-py2.7.egg/mxnet/kvstore_server.py", line 63, in _init_kvstore_server_module
kvstore = create('dist')
File "/usr/local/lib/python2.7/dist-packages/mxnet-0.5.0-py2.7.egg/mxnet/kvstore.py", line 378, in create
ctypes.byref(handle)))
File "/usr/local/lib/python2.7/dist-packages/mxnet-0.5.0-py2.7.egg/mxnet/base.py", line 76, in check_call
raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [17:13:44] src/kvstore/kvstore.cc:41: compile with USE_DIST_KVSTORE=1 to use dist
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/mxnet/tools/../ps-lite/tracker/tracker.py", line 351, in <lambda>
self.thread = Thread(target = (lambda : subprocess.check_call(self.cmd, env=env, shell=True)), args = ())
File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
CalledProcessError: Command 'python example/image-classification/train_mnist.py --kv-store dist_sync' returned non-zero exit status 1

wsybupt avatar Dec 22 '15 09:12 wsybupt

please reinstall the python package

mli avatar Dec 22 '15 19:12 mli

@mli Thank you very much ! Now the message is

root@wsy-ThinkCentre-XXXX:/mxnet# tools/launch.py -n 2 -H hosts python example/image-classification/train_mnist.py --kv-store dist_sync
ssh: Could not resolve hostname export dmlc_role=worker; export dmlc_ps_root_port=9729; export dmlc_ps_root_uri=10.108.165.17; expor: Name or service not known
Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/mxnet/tools/../ps-lite/tracker/dmlc_ssh.py", line 60, in run
    subprocess.check_call(prog, shell = True)
  File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
CalledProcessError: Command 'ssh -o StrictHostKeyChecking=no  'export DMLC_ROLE=worker; export DMLC_PS_ROOT_PORT=9729; export DMLC_PS_ROOT_URI=10.108.165.17; export DMLC_NUM_SERVER=2; export DMLC_NUM_WORKER=2; cd /mxnet/; python example/image-classification/train_mnist.py --kv-store dist_sync'' returned non-zero exit status 255

10.108.165.17 is the machine I run the command.

wsybupt avatar Dec 23 '15 07:12 wsybupt

@mli I exec make clean_all first, than make -j 32 USE_DIST_KVSTORE=1 USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1, after compiled, cd python, exec pip install -e . I have done all of above, but the ‘mxnet.base.MXNetError: [17:13:44] src/kvstore/kvstore.cc:41: compile with USE_DIST_KVSTORE=1 to use dist’ still shows. Did I miss anything? what's the meaning of "reinstall the python package"?

hanalice avatar May 31 '18 07:05 hanalice

what does mean reinstall python ? linux python or mxnet python ?

ChChwang avatar Jul 08 '18 09:07 ChChwang