fix: create result file
This commit is contained in:
parent
d98a817d51
commit
bc67103752
@ -236,10 +236,13 @@ def stones_to_board(black_stones, white_stones, black_plays):
|
|||||||
|
|
||||||
|
|
||||||
def position_predict(black_stones, white_stones, depth):
|
def position_predict(black_stones, white_stones, depth):
|
||||||
board = stones_to_board(black_stones, white_stones, depth % 2 == 0)
|
board = torch.from_numpy(np.array([
|
||||||
|
stones_to_board(black_stones, white_stones, depth % 2 == 0)
|
||||||
|
])).float().to(device)
|
||||||
|
|
||||||
|
mymodel.eval()
|
||||||
with torch.no_grad():
|
with torch.no_grad():
|
||||||
prediction = mymodel(board.unsqueeze(0))
|
prediction = mymodel(board)
|
||||||
|
|
||||||
return prediction
|
return prediction
|
||||||
|
|
||||||
@ -310,6 +313,7 @@ if __name__ == "__main__":
|
|||||||
with gzip.open(args.R) as fz:
|
with gzip.open(args.R) as fz:
|
||||||
data = json.loads(fz.read().decode("utf-8"))
|
data = json.loads(fz.read().decode("utf-8"))
|
||||||
create_result_file(data)
|
create_result_file(data)
|
||||||
|
exit(0)
|
||||||
|
|
||||||
if args.t is not None and args.T is not None:
|
if args.t is not None and args.T is not None:
|
||||||
trainset = torch.load(args.t)
|
trainset = torch.load(args.t)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user