分布式 Tensorflow 不适用于简单示例
Distributed Tensorflow not working with simple example
我正在按照示例 here 学习 MNIST 上的分布式 TF。我将集群配置更改为:
parameter_servers = ["1.2.3.4:2222"]
workers = [ "1.2.3.4:2222", "5.6.7.8:2222"]
1.2.3.4
和 5.6.7.8
只是我的两个节点的表示。它们不是真实的 IP 地址。整个脚本命名为example.py
在1.2.3.4
,我运行:python example.py --job_name=ps --task_index=0
.然后在同一台机器上,我 运行 python example --job_name=worker --task_index=0
在不同的终端。看来只能等了
在 5,6,7,8
,我 运行 python example.py --job_name=worker --taks_index=1
。之后我立即在 5.6.7.8
:
上收到以下错误
tensorflow.python.framework.errors.UnavailableError: {"created":"@1480458325.580095889","description":"EOF","file":"external/grpc/src/core/lib/iomgr/tcp_posix.c","file_line":235,"grpc_status":14}
I tensorflow/core/distributed_runtime/master_session.cc:845] DeregisterGraph error: Aborted: Graph handle is not found: . Possibly, this worker just restarted.
和
tensorflow/core/distributed_runtime/graph_mgr.cc:55] 'unit.device' Must be non NULL
Aborted (core dumped)
在 1.2.3.4
这是因为我运行在同一台机器上既是参数服务器又是工作人员吗?我没有超过 2 个节点,那么我该如何解决这个问题?
所以一天后我终于得到了修复:
- 按照 Yaroslav 对参数服务器的建议进行操作,这样 worker 就不会 运行 GPU 内存不足
- param server和worker不能运行在同一个端口(原来的post),所以把
workers = [ "1.2.3.4:2222", "5.6.7.8:2222"]
改成workers = [ "1.2.3.4:2223", "5.6.7.8:2222"]
。注意端口号的变化。
这就是所有需要完成的事情。
我正在按照示例 here 学习 MNIST 上的分布式 TF。我将集群配置更改为:
parameter_servers = ["1.2.3.4:2222"]
workers = [ "1.2.3.4:2222", "5.6.7.8:2222"]
1.2.3.4
和 5.6.7.8
只是我的两个节点的表示。它们不是真实的 IP 地址。整个脚本命名为example.py
在1.2.3.4
,我运行:python example.py --job_name=ps --task_index=0
.然后在同一台机器上,我 运行 python example --job_name=worker --task_index=0
在不同的终端。看来只能等了
在 5,6,7,8
,我 运行 python example.py --job_name=worker --taks_index=1
。之后我立即在 5.6.7.8
:
tensorflow.python.framework.errors.UnavailableError: {"created":"@1480458325.580095889","description":"EOF","file":"external/grpc/src/core/lib/iomgr/tcp_posix.c","file_line":235,"grpc_status":14}
I tensorflow/core/distributed_runtime/master_session.cc:845] DeregisterGraph error: Aborted: Graph handle is not found: . Possibly, this worker just restarted.
和
tensorflow/core/distributed_runtime/graph_mgr.cc:55] 'unit.device' Must be non NULL
Aborted (core dumped)
在 1.2.3.4
这是因为我运行在同一台机器上既是参数服务器又是工作人员吗?我没有超过 2 个节点,那么我该如何解决这个问题?
所以一天后我终于得到了修复:
- 按照 Yaroslav 对参数服务器的建议进行操作,这样 worker 就不会 运行 GPU 内存不足
- param server和worker不能运行在同一个端口(原来的post),所以把
workers = [ "1.2.3.4:2222", "5.6.7.8:2222"]
改成workers = [ "1.2.3.4:2223", "5.6.7.8:2222"]
。注意端口号的变化。
这就是所有需要完成的事情。