fedden / poker_ai

🤖 An Open Source Texas Hold'em AI
Other
1.37k stars 372 forks source link

All workers' actions are "idle". Does it make sense? #159

Open XinWang0219 opened 1 year ago

XinWang0219 commented 1 year ago

Describe the bug During training, all workers' actions are "idle". Does it make sense? Or do I do something wrong in the steps before?

To Reproduce Steps to reproduce the behavior:

  1. After run "poker_ai cluster", get two files "card_info_lut.joblib" and "centroids.joblib".
  2. I create directory "./research/blueprint_algo" and put these files in it.
  3. Then run "poker_ai train start --lut_path ./research/blueprint_algo --sync_cfr --sync_discount --sync_serialise"

Expected behavior I don't know whether these 'Woker-i': 'idle' are what they should be. But while I run "poker_ai play" and get "UnboundLocalError: local variable 'action' referenced before assignment", I think it may be because 'idle' is not in the expected choices of actions.

Screenshots [23:12:01] INFO Sending synchronised cfr to workers server.py:196 INFO {'Worker-3': 'idle', 'Worker-4': 'idle', 'Worker-5': 'idle', 'Worker-6': 'idle', server.py:197 'Worker-7': 'idle', 'Worker-8': 'idle', 'Worker-9': 'idle'} INFO Worker-7 updating status to cfr server.py:97 INFO Worker-7 updating status to idle server.py:97 INFO Worker-8 updating status to cfr server.py:97 INFO Worker-8 updating status to idle server.py:97 INFO Worker-9 updating status to cfr server.py:97 INFO Worker-9 updating status to idle server.py:97 INFO Sending synchronised cfr to workers server.py:196 INFO {'Worker-3': 'idle', 'Worker-4': 'idle', 'Worker-5': 'idle', 'Worker-6': 'idle', server.py:197 'Worker-7': 'idle', 'Worker-8': 'idle', 'Worker-9': 'idle'} [23:12:03] INFO Sending synchronised cfr to workers server.py:196 INFO {'Worker-3': 'idle', 'Worker-4': 'idle', 'Worker-5': 'idle', 'Worker-6': 'idle', server.py:197 'Worker-7': 'idle', 'Worker-8': 'idle', 'Worker-9': 'idle'} [23:12:04] INFO Sending synchronised cfr to workers server.py:196 INFO {'Worker-3': 'idle', 'Worker-4': 'idle', 'Worker-5': 'idle', 'Worker-6': 'idle', server.py:197 'Worker-7': 'idle', 'Worker-8': 'idle', 'Worker-9': 'idle'} [23:12:05] INFO Worker-3 updating status to cfr server.py:97 INFO Worker-3 updating status to idle server.py:97 INFO Worker-4 updating status to cfr server.py:97 INFO Worker-4 updating status to idle server.py:97 INFO Worker-5 updating status to cfr server.py:97 INFO Worker-5 updating status to idle server.py:97 INFO {'Worker-6': 'update_strategy'} server.py:251 INFO Sending synchronised cfr to workers server.py:196 INFO {'Worker-3': 'idle', 'Worker-4': 'idle', 'Worker-5': 'idle', 'Worker-6': 'idle', server.py:197 'Worker-7': 'idle', 'Worker-8': 'idle', 'Worker-9': 'idle'} [23:12:08] INFO {'Worker-8': 'update_strategy'} server.py:251 INFO Sending synchronised cfr to workers server.py:196 INFO {'Worker-3': 'idle', 'Worker-4': 'idle', 'Worker-5': 'idle', 'Worker-6': 'idle', server.py:197 'Worker-7': 'idle', 'Worker-8': 'idle', 'Worker-9': 'idle'} [23:12:10] INFO {'Worker-3': 'update_strategy'} server.py:251 INFO Sending synchronised cfr to workers server.py:196 INFO {'Worker-3': 'idle', 'Worker-4': 'idle', 'Worker-5': 'idle', 'Worker-6': 'idle', server.py:197 'Worker-7': 'idle', 'Worker-8': 'idle', 'Worker-9': 'idle'} INFO Sending synchronised serialise to workers server.py:196 INFO {'Worker-3': 'idle', 'Worker-4': 'idle', 'Worker-5': 'idle', 'Worker-6': 'idle', server.py:197 'Worker-7': 'idle', 'Worker-8': 'idle', 'Worker-9': 'idle'}

Optimisation iterations 83%|████████████████████████████████████████████▋ | 1239/1500 [1h 23:36<17:37, 0.25 iter/s]

Desktop (please complete the following information):

c976237222 commented 1 year ago

请问这个问题您解决了吗 我也是都是idle Have you solved this problem? I am also idle

380799631 commented 1 year ago

这个空闲应该不是不做事情,而是为了同步多个进程的资源。 用确保所有的工作进程(workers)在开始同步任务之前都处于闲置状态。这样做是为了避免在同步任务执行期间发生资源竞争或数据冲突。