minor fixed
This commit is contained in:
parent
a381577fc7
commit
8bedac5978
@ -2,6 +2,7 @@ from game import Game
|
|||||||
from engine import GTPEngine
|
from engine import GTPEngine
|
||||||
import re
|
import re
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import os
|
||||||
from collections import deque
|
from collections import deque
|
||||||
import utils
|
import utils
|
||||||
import argparse
|
import argparse
|
||||||
@ -10,6 +11,9 @@ parser = argparse.ArgumentParser()
|
|||||||
parser.add_argument('--result_path', type=str, default='./part1')
|
parser.add_argument('--result_path', type=str, default='./part1')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
if not os.path.exists(args.result_path):
|
||||||
|
os.makedirs(args.result_path)
|
||||||
|
|
||||||
game = Game()
|
game = Game()
|
||||||
engine = GTPEngine(game_obj=game)
|
engine = GTPEngine(game_obj=game)
|
||||||
history = deque(maxlen=8)
|
history = deque(maxlen=8)
|
||||||
@ -83,7 +87,7 @@ while True:
|
|||||||
winner = np.ones([num, 1]) * winner
|
winner = np.ones([num, 1]) * winner
|
||||||
assert state.shape[0] == prob.shape[0]
|
assert state.shape[0] == prob.shape[0]
|
||||||
assert state.shape[0] == winner.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 = []
|
state = []
|
||||||
prob = []
|
prob = []
|
||||||
winner = []
|
winner = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user