Skip to content

Commit 1f04c1d

Browse files
committed
bind worker within lambda to avoid running worker twice
1 parent 762f34c commit 1f04c1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PolicyGradient/a3c/train.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def make_env(wrap=True):
125125
# Start worker threads
126126
worker_threads = []
127127
for worker in workers:
128-
worker_fn = lambda: worker.run(sess, coord, FLAGS.t_max)
128+
worker_fn = lambda worker=worker: worker.run(sess, coord, FLAGS.t_max)
129129
t = threading.Thread(target=worker_fn)
130130
t.start()
131131
worker_threads.append(t)

0 commit comments

Comments
 (0)