import tensorflow as tf

                      env_floor=0) for i in range(N_WORKER)]

    # 觀察者
    # workers.append(Worker(envpath='./ObstacleTower/obstacletower.exe',
    #                       wid=N_WORKER + 1,
    #                       retro=False,
    #                       realtime_mode=True,
    #                       env_seed=0,
    #                       env_floor=0))

    GLOBAL_UPDATE_COUNTER, GLOBAL_EP = 0, 0
    GLOBAL_RUNNING_R = []
    COORD = tf.train.Coordinator()
    # 宣告共用記憶體
    QUEUE = queue.Queue()
    threads = []
    for worker in workers:  # worker threads
        t = threading.Thread(target=worker.work, args=())
        t.start()  # training
        threads.append(t)
    # 建立模型更新的執行緒
    threads.append(threading.Thread(target=GLOBAL_KPRUN.update, ))
    threads[-1].start()
    COORD.join(threads)
