minor fixed on self play

This commit is contained in:
rtz19970824 2017-12-11 15:56:16 +08:00
parent 715f7be6a8
commit e88d651400
2 changed files with 10 additions and 7 deletions

View File

@ -192,6 +192,9 @@ class Network(object):
# checkpoint_path = "/home/tongzheng/tianshou/AlphaGo/checkpoints/" # checkpoint_path = "/home/tongzheng/tianshou/AlphaGo/checkpoints/"
# sess = multi_gpu.create_session() # sess = multi_gpu.create_session()
# sess.run(tf.global_variables_initializer()) # sess.run(tf.global_variables_initializer())
if checkpoint_path is None:
self.sess.run(tf.global_variables_initializer())
else:
ckpt_file = tf.train.latest_checkpoint(checkpoint_path) ckpt_file = tf.train.latest_checkpoint(checkpoint_path)
if ckpt_file is not None: if ckpt_file is not None:
# print('Restoring model from {}...'.format(ckpt_file)) # print('Restoring model from {}...'.format(ckpt_file))

View File

@ -14,7 +14,7 @@ args = parser.parse_args()
if not os.path.exists(args.result_path): if not os.path.exists(args.result_path):
os.makedirs(args.result_path) os.makedirs(args.result_path)
game = Game() game = Game(checkpoint_path="./checkpoints/")
engine = GTPEngine(game_obj=game) engine = GTPEngine(game_obj=game)
history = deque(maxlen=8) history = deque(maxlen=8)
for i in range(8): for i in range(8):