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
# 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
what is hosts's content
@qiaohaijun 10.108.165.17 is the machine I run the command.
#cat hosts
10.109.253.71
10.109.253.99
it looks like launch.py is failed to read hosts
Em… What can I do?
@mli But if I edit the hosts to include a machine that is shut down, the following message is added:
ssh: connect to hosts 10.108.165.123 port 22: No route to host
you can add a debug print print self.hosts on LINE 26, ps-lite/tracker/dmlc_ssh.py
https://github.com/dmlc/ps-lite/blob/master/tracker/dmlc_ssh.py#L25
to double check the hostfile is loaded correctly
@mli I have checked the hostfile is loaded correctly. The machie I run the command is 10.108.165.17. When there is a machie shutdown, the message:
root@wsy-ThinkCentre-XXXX:/mxnet# tools/launch.py -n 2 -H hosts python example/image-classification/train_mnist.py --kv-store dist_sync
['10.109.253.99', '10.108.165.123', '']
ssh: Could not resolve hostname export dmlc_role=worker; export dmlc_ps_root_port=9378; 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=9378; 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
ssh: connect to host 10.108.165.123 port 22: No route to host
Exception in thread Thread-3:
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 10.108.165.123 'export DMLC_ROLE=server; export DMLC_PS_ROOT_PORT=9378; 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
When there is no machie shutdown:
root@wsy-ThinkCentre-XXXX:/mxnet# tools/launch.py -n 2 -H hosts python example/image-classification/train_mnist.py --kv-store dist_sync
['10.109.253.99', '10.109.253.71', '']
ssh: Could not resolve hostname export dmlc_role=worker; export dmlc_ps_root_port=9420; 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=9420; 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
your host file has a empty line delete it and try again
@mli the empty line of host file cause this issue , I have take a PR to ps-lite
@qiaohaijun You are right! Thank you~ @mli Thank you!
@wsybupt you are welcome! go on!
@wsybupt if the problem is fixed, please close this issue.
After the training is done, there is some message wrong. What's the problem? @qiaohaijun @mli
2015-12-26 20:31:28,647 Node[0] Epoch[9] Validation-accuracy=0.966346
OpenCV is unavailable.
OpenCV is unavailable.
Segmentation fault
OpenCV is unavailable.
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 139
If this helps someone in the future, in my case I had to make sure that the hostnames are resolvable. I added the IP addresses to /etc/hosts file before running the distributed training.
$ cat /etc/hosts
127.0.0.1 localhost
10.40.0.252 das-1
10.40.0.46 mxnet-1
10.40.0.47 mxnet-2
10.40.0.52 mxnet-3
10.40.0.49 mxnet-4
10.40.0.48 mxnet-5
10.40.0.53 mxnet-6
10.40.0.51 mxnet-7
10.40.0.55 mxnet-8
10.40.0.54 mxnet-9
...
$ cat mxnet_hosts
10.40.0.252
10.40.0.46
10.40.0.47
10.40.0.52
10.40.0.49
10.40.0.48
10.40.0.53
10.40.0.51
10.40.0.55
10.40.0.54