Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion code/5_control_flow_analysis/5.2_best_practice.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def main(unused_argv):
"ps": ps_spec,
"worker": worker_spec})

server = tf.train.Server(cluster, job_name=FLAGS.job_name, task_index=FLAGS.task_index)
# 如果是ps,直接启动服务,并开始监听worker发起的请求
if FLAGS.job_name == "ps":
server.join()
Expand Down Expand Up @@ -238,4 +239,4 @@ def main(unused_argv):


if __name__ == "__main__":
tf.app.run()
tf.app.run()