繁体   English   中英

分布式Tensorflow不适用于简单示例

[英]Distributed Tensorflow not working with simple example

我在这里跟随一个示例以在MNIST上学习分布式TF。 我将集群配置更改为:

parameter_servers = ["1.2.3.4:2222"]
workers = [ "1.2.3.4:2222", "5.6.7.8:2222"]

1.2.3.45.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个,该如何解决?

因此,经过一天的努力,我终于得到了解决:

  1. 按照Yaroslav对参数服务器的建议进行操作,以确保工作线程不会耗尽GPU内存
  2. 参数服务器和worker无法在同一端口上运行(与原始帖子一样),因此将workers = [ "1.2.3.4:2222", "5.6.7.8:2222"]更改为workers = [ "1.2.3.4:2223", "5.6.7.8:2222"] 注意端口号的变化。

这就是需要做的所有事情。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM