The tf.Session has parameter target, it can be '', grpc://ip:port, or tf.train.Server().target, what is the difference between them? And when we create a session, does it mean we create a client, if we have client what is server?
Update
- What is the master? Is it chief worker? And what is difference between
''andgrpc://localhost:port?I think they are both on the local computer.
Some questions about your local_distributed_benchmark.py
I add
print(add_op.device)increate_graph(device1, device2), the output is/job:worker/task:0, why not/job:worker/task:1? And you createtf.Session("grpc://"+host+FLAGS.port1, config=default_config()), if ops is created on other tasks(worker), how does this session run those ops, likeinit_op = tf.initialize_all_variables()on your program.If I use
sess = tf.Session(config=default_config())instead ofsess = tf.Session("grpc://"+host+FLAGS.port1, config=default_config()), it will raise an error:
Cannot assign a device for operation 'update': Operation was explicitly assigned to /job:worker/task:1 but avail able devices are [ /job:localhost/replica:0/task:0/cpu:0, /job:localhost/replica:0/task:0/gpu:0 ].
What's wrong?
- If I delete runcmd("python %s --task=1"%(sys.argv[0])) and change with tf.device(device2): to
with tf.device(device1):, the program will outputCreateSession still waiting for response from worker: /job:worker/replica:0/task:1. I only use session of targettask:0, and don't use anyopsontask:1, so why does program wait fortask:1 workerto start?