Tianshou/AlphaGo/test.py

20 lines
512 B
Python
Raw Normal View History

2017-12-08 17:05:33 +08:00
import sys
from game import Game
from engine import GTPEngine
# import utils
2017-12-09 21:41:11 +08:00
import argparse
import time
2017-12-08 17:05:33 +08:00
2017-12-09 21:41:11 +08:00
parser = argparse.ArgumentParser()
parser.add_argument("--checkpoint_path", type=str, default="./checkpoints/")
args = parser.parse_args()
game = Game(checkpoint_path=args.checkpoint_path)
engine = GTPEngine(game_obj=game, name='tianshou', version=0)
2017-12-08 17:05:33 +08:00
while not engine.disconnect:
2017-12-09 21:41:11 +08:00
command = sys.stdin.readline()
2017-12-08 17:05:33 +08:00
result = engine.run_cmd(command)
sys.stdout.write(result)
sys.stdout.flush()