def run(self):
with self.sv.managed_session(self.server.target, config=self.config_proto) as sess, sess.as_default():
print("DPPO worker {} in managed session".format(self.task_id))
while not self.sv.should_stop():
message = None
while message != "collect":
After Change
def run(self):
with tf.Session() as sess, sess.as_default():
var_receivers = [np.zeros(var.shape.as_list(), dtype=var.dtype.as_numpy_dtype) for var in self.global_vars]
while True:
for var_receiver, tf_var in zip(var_receivers, self.global_vars):
self.comm.Bcast(var_receiver, root=0)