minor fixed

This commit is contained in:
rtz19970824 2017-12-08 18:08:15 +08:00
parent a381577fc7
commit 8bedac5978

View File

@ -2,6 +2,7 @@ from game import Game
from engine import GTPEngine
import re
import numpy as np
import os
from collections import deque
import utils
import argparse
@ -10,6 +11,9 @@ parser = argparse.ArgumentParser()
parser.add_argument('--result_path', type=str, default='./part1')
args = parser.parse_args()
if not os.path.exists(args.result_path):
os.makedirs(args.result_path)
game = Game()
engine = GTPEngine(game_obj=game)
history = deque(maxlen=8)
@ -83,7 +87,7 @@ while True:
winner = np.ones([num, 1]) * winner
assert state.shape[0] == prob.shape[0]
assert state.shape[0] == winner.shape[0]
np.savez(args.result_path + "/game" + game_num, state=state, prob=prob, winner=winner)
np.savez(args.result_path + "/game" + str(game_num), state=state, prob=prob, winner=winner)
state = []
prob = []
winner = []