1 Star 0 Fork 1

吉法师/SuperGo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.py 1.34 KB
一键复制 编辑 原始数据 按行查看 历史
吉法师 提交于 2021-10-20 21:32 . 改superGo源码
import multiprocessing
import time
import signal
import click
import os
from lib.train import train
from lib.play import play, self_play
from lib.process import MyPool
@click.command()
@click.option("--folder", default=-1)
@click.option("--version", default=False)
def main(folder, version):
## Start method for PyTorch
multiprocessing.set_start_method('spawn')
## Create folder name if not provided
if folder == -1:
current_time = str(int(time.time()))
else:
current_time = str(folder)
current_time = str(1634727179)
## Catch SIGNINT
original_sigint_handler = signal.signal(signal.SIGINT, signal.SIG_IGN)
# pool = MyPool(2)
# signal.signal(signal.SIGINT, original_sigint_handler)
#
# try:
# # self_play_proc = pool.apply_async(self_play, args=(current_time, version,))
# train_proc = pool.apply_async(train, args=(current_time, version,))
#
# ## Comment one line or the other to get the stack trace
# ## Must add a loooooong timer otherwise signals are not caught
# # self_play_proc.get(60000000)
# train_proc.get(60000000)
#
# except KeyboardInterrupt:
# pool.terminate()
# else:
# pool.close()
# pool.join()
self_play(current_time,False)
# train(current_time,False)
if __name__ == "__main__":
main()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/Jifashi_619/SuperGo.git
git@gitee.com:Jifashi_619/SuperGo.git
Jifashi_619
SuperGo
SuperGo
master

搜索帮助