Giter Site home page Giter Site logo

neymarl / chinesechess-alphazero Goto Github PK

View Code? Open in Web Editor NEW
1.0K 50.0 337.0 1.15 GB

Implement AlphaZero/AlphaGo Zero methods on Chinese chess.

Home Page: https://cczero.org

License: GNU General Public License v3.0

Python 100.00%
reinforcement-learning alphazero deep-learning chinese-chess

chinesechess-alphazero's Introduction

**象棋Zero(CCZero)

App Icon

About

Chinese Chess reinforcement learning by AlphaZero methods.

This project is based on these main resources:

  1. DeepMind's Oct 19th publication: Mastering the Game of Go without Human Knowledge.
  2. The great Reversi/Chess/Chinese chess development of the DeepMind ideas that @mokemokechicken/@Akababa/@TDteach did in their repo: https://github.com/mokemokechicken/reversi-alpha-zero, https://github.com/Akababa/Chess-Zero, https://github.com/TDteach/AlphaZero_ChineseChess
  3. A Chinese chess engine with gui: https://github.com/mm12432/MyChess

Help to train

In order to build a strong chinese chess AI following the same type of techniques as AlphaZero, we need to do this with a distributed project, as it requires a huge amount of computations.

If you want to join us to build the best chinese chess AI in the world:

elo

Environment

  • Python 3.6.3
  • tensorflow-gpu: 1.3.0
  • Keras: 2.0.8

Modules

Reinforcement Learning

This AlphaZero implementation consists of two workers: self and opt.

  • self is Self-Play to generate training data by self-play using BestModel.
  • opt is Trainer to train model, and generate new models.

For the sake of faster training, another two workers are involved:

  • sl is Supervised learning to train data crawled from the Internet.
  • eval is Evaluator to evaluate the NextGenerationModel with the current BestModel.

Built-in GUI

Requirement: pygame

python cchess_alphazero/run.py play

Screenshots

board

You can choose different board/piece styles and sides, see play with human.

How to use

Setup

install libraries

pip install -r requirements.txt

If you want to use CPU only, replace tensorflow-gpu with tensorflow in requirements.txt.

Make sure Keras is using Tensorflow and you have Python 3.6.3+.

Configuration

PlayDataConfig

  • nb_game_in_file, max_file_num: The max game number of training data is nb_game_in_file * max_file_num.

PlayConfig, PlayWithHumanConfig

  • simulation_num_per_move : MCTS number per move.
  • c_puct: balance parameter of value network and policy network in MCTS.
  • search_threads: balance parameter of speed and accuracy in MCTS.
  • dirichlet_alpha: random parameter in self-play.

Full Usage

usage: run.py [-h] [--new] [--type TYPE] [--total-step TOTAL_STEP]
              [--ai-move-first] [--cli] [--gpu GPU] [--onegreen] [--skip SKIP]
              [--ucci] [--piece-style {WOOD,POLISH,DELICATE}]
              [--bg-style {CANVAS,DROPS,GREEN,QIANHONG,SHEET,SKELETON,WHITE,WOOD}]
              [--random {none,small,medium,large}] [--distributed] [--elo]
              {self,opt,eval,play,eval,sl,ob}

positional arguments:
  {self,opt,eval,play,eval,sl,ob}
                        what to do

optional arguments:
  -h, --help            show this help message and exit
  --new                 run from new best model
  --type TYPE           use normal setting
  --total-step TOTAL_STEP
                        set TrainerConfig.start_total_steps
  --ai-move-first       set human or AI move first
  --cli                 play with AI with CLI, default with GUI
  --gpu GPU             device list
  --onegreen            train sl work with onegreen data
  --skip SKIP           skip games
  --ucci                play with ucci engine instead of self play
  --piece-style {WOOD,POLISH,DELICATE}
                        choose a style of piece
  --bg-style {CANVAS,DROPS,GREEN,QIANHONG,SHEET,SKELETON,WHITE,WOOD}
                        choose a style of board
  --random {none,small,medium,large}
                        choose a style of randomness
  --distributed         whether upload/download file from remote server
  --elo                 whether to compute elo score

Self-Play

python cchess_alphazero/run.py self

When executed, self-play will start using BestModel. If the BestModel does not exist, new random model will be created and become BestModel. Self-play records will store in data/play_record and BestMode will store in data/model.

options

  • --new: create new BestModel
  • --type mini: use mini config, (see cchess_alphazero/configs/mini.py)
  • --gpu '1': specify which gpu to use
  • --ucci: whether to play with ucci engine (rather than self play, see cchess_alphazero/worker/play_with_ucci_engine.py)
  • --distributed: run self play in distributed mode which means it will upload the play data to the remote server and download latest model from it

Note1: To help training, you should run python cchess_alphazero/run.py --type distribute --distributed self (and do not change the configuration file configs/distribute.py), for more info, see wiki.

Note2: If you want to view the self-play records in GUI, see wiki.

Trainer

python cchess_alphazero/run.py opt

When executed, Training will start. The current BestModel will be loaded. Trained model will be saved every epoch as new BestModel.

options

  • --type mini: use mini config, (see cchess_alphazero/configs/mini.py)
  • --total-step TOTAL_STEP: specify total step(mini-batch) numbers. The total step affects learning rate of training.
  • --gpu '1': specify which gpu to use

View training log in Tensorboard

tensorboard --logdir logs/

And access http://<The Machine IP>:6006/.

Play with human

Run with built-in GUI

python cchess_alphazero/run.py play

When executed, the BestModel will be loaded to play against human.

options

  • --ai-move-first: if set this option, AI will move first, otherwise human move first.
  • --type mini: use mini config, (see cchess_alphazero/configs/mini.py)
  • --gpu '1': specify which gpu to use
  • --piece-style WOOD: choose a piece style, default is WOOD
  • --bg-style CANVAS: choose a board style, default is CANVAS
  • --cli: if set this flag, play with AI in a cli environment rather than gui

Note: Before you start, you need to download/find a font file (.ttc) and rename it as PingFang.ttc, then put it into cchess_alphazero/play_games. I have removed the font file from this repo because it's too big, but you can download it from here.

You can also download Windows executable directly from here. For more information, see wiki.

UCI mode

python cchess_alphazero/uci.py

If you want to play in general GUIs such as '冰河五四', you can download the Windows executable here. For more information, see wiki.

Evaluator

python cchess_alphazero/run.py eval

When executed, evaluate the NextGenerationModel with the current BestModel. If the NextGenerationModel does not exist, worker will wait until it exists and check every 5 minutes.

options

  • --type mini: use mini config, (see cchess_alphazero/configs/mini.py)
  • --gpu '1': specify which gpu to use

Supervised Learning

python cchess_alphazero/run.py sl

When executed, Training will start. The current SLBestModel will be loaded. Tranined model will be saved every epoch as new SLBestModel.

About the data

I have two data sources, one is downloaded from https://wx.jcloud.com/market/packet/10479 ; the other is crawled from http://game.onegreen.net/chess/Index.html (with option --onegreen).

options

  • --type mini: use mini config, (see cchess_alphazero/configs/mini.py)
  • --gpu '1': specify which gpu to use
  • --onegreen: if set the flag, sl_onegreen worker will start to train data crawled from game.onegreen.net
  • --skip SKIP: if set this flag, games whoses index is less than SKIP would not be used to train (only valid when onegreen flag is set)

chinesechess-alphazero's People

Contributors

neymarl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chinesechess-alphazero's Issues

About the MCTS parameters

Thanks for your excellent work!

I implemented an AlphaGomoku Zero a few months ago. The algorithm indeed works to some extend, but after trainning for about 1500 steps (each step has a mini-batch of 256), the agent seems to stop learning and just chooses almost the same action and makes the same mistake.
I fund that in AlphaGo Zero's paper, the MCTS parameters such as "c_puct" is optimized by Gaussian process:

MCTS search parameters were selected by Gaussian process optimization, so as to optimize self­-play performance of AlphaGo Zero using a neural network trained in a preliminary run.

I am not familiar with Gaussian process, in my implementation, the c_puct is a constant. I wonder how do you deal with the c_puct, and how gaussian process is applied to this scenario. Could you share your opinion?

something wrong with “play”

ValueError: Shape must be rank 1 but is rank 0 for 'input_batchnorm/cond/Reshape_4' (op: 'Reshape') with input shapes: [1,192,1,1], []

[Error] Self paly with flag --ucci raising error

After install the requirements, I typed the python cchess_alphazero/run.py play

I got this error raised

Traceback (most recent call last):
  File "/home/yaoxingliu/.conda/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1626, in _create_c_op
    c_op = c_api.TF_FinishOperation(op_desc)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Shape must be rank 1 but is rank 0 for 'input_batchnorm/cond/Reshape_4' (op: 'Reshape') with input shapes: [1,192,1,1], [].

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "cchess_alphazero/run.py", line 14, in <module>
    manager.start()
  File "/media/yaoxingliu/Project/DeepLearning/ChineseChess-AlphaZero/cchess_alphazero/manager.py", line 93, in start
    play.start(config, not args.ai_move_first)
  File "/media/yaoxingliu/Project/DeepLearning/ChineseChess-AlphaZero/cchess_alphazero/play_games/play.py", line 36, in start
    play.start(human_move_first)
  File "/media/yaoxingliu/Project/DeepLearning/ChineseChess-AlphaZero/cchess_alphazero/play_games/play.py", line 100, in start
    self.load_model()
  File "/media/yaoxingliu/Project/DeepLearning/ChineseChess-AlphaZero/cchess_alphazero/play_games/play.py", line 64, in load_model
    if self.config.opts.new or not load_best_model_weight(self.model):
  File "/media/yaoxingliu/Project/DeepLearning/ChineseChess-AlphaZero/cchess_alphazero/lib/model_helper.py", line 13, in load_best_model_weight
    return model.load(model.config.resource.model_best_config_path, model.config.resource.model_best_weight_path)
  File "/media/yaoxingliu/Project/DeepLearning/ChineseChess-AlphaZero/cchess_alphazero/agent/model.py", line 99, in load
    self.model = Model.from_config(json.load(f))
  File "/home/yaoxingliu/.conda/envs/tensorflow/lib/python3.6/site-packages/keras/engine/network.py", line 1032, in from_config
    process_node(layer, node_data)
  File "/home/yaoxingliu/.conda/envs/tensorflow/lib/python3.6/site-packages/keras/engine/network.py", line 991, in process_node
    layer(unpack_singleton(input_tensors), **kwargs)
  File "/home/yaoxingliu/.conda/envs/tensorflow/lib/python3.6/site-packages/keras/engine/base_layer.py", line 457, in __call__
    output = self.call(inputs, **kwargs)
  File "/home/yaoxingliu/.conda/envs/tensorflow/lib/python3.6/site-packages/keras/layers/normalization.py", line 206, in call
    training=training)
  File "/home/yaoxingliu/.conda/envs/tensorflow/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 3123, in in_train_phase
    x = switch(training, x, alt)
  File "/home/yaoxingliu/.conda/envs/tensorflow/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 3058, in switch
    else_expression_fn)
  File "/home/yaoxingliu/.conda/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 488, in new_func
    return func(*args, **kwargs)
  File "/home/yaoxingliu/.conda/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2087, in cond
    orig_res_f, res_f = context_f.BuildCondBranch(false_fn)
  File "/home/yaoxingliu/.conda/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 1920, in BuildCondBranch
    original_result = fn()
  File "/home/yaoxingliu/.conda/envs/tensorflow/lib/python3.6/site-packages/keras/layers/normalization.py", line 167, in normalize_inference
    epsilon=self.epsilon)
  File "/home/yaoxingliu/.conda/envs/tensorflow/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 1908, in batch_normalization
    mean = tf.reshape(mean, (-1))
  File "/home/yaoxingliu/.conda/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 6296, in reshape
    "Reshape", tensor=tensor, shape=shape, name=name)
  File "/home/yaoxingliu/.conda/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
    op_def=op_def)
  File "/home/yaoxingliu/.conda/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 488, in new_func
    return func(*args, **kwargs)
  File "/home/yaoxingliu/.conda/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3272, in create_op
    op_def=op_def)
  File "/home/yaoxingliu/.conda/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1790, in __init__
    control_input_ops)
  File "/home/yaoxingliu/.conda/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1629, in _create_c_op
    raise ValueError(str(e))
ValueError: Shape must be rank 1 but is rank 0 for 'input_batchnorm/cond/Reshape_4' (op: 'Reshape') with input shapes: [1,192,1,1], [].

Failed to execute script play_games

Traceback (most recent call last):
File "play_games.py", line 43, in
File "cchess_alphazero\play_games\play.py", line 37, in start
File "cchess_alphazero\play_games\play.py", line 107, in start
File "cchess_alphazero\play_games\play.py", line 82, in init_screen
OSError: unable to read font file 'D:\桌面的文件\play_games-gpu-cuda8\play_games\cchess_alphazero\play_games\PingFang.ttc'
[13948] Failed to execute script play_games

hello, there are some error when run "python3 run.py self"

018-08-26 10:09:03,172@cchess_alphazero.agent.api ERROR # EOF error:
Exception in thread prediction_worker:
Traceback (most recent call last):
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/home/fly/cetrol_workspace/ChineseChess-AlphaZero-distributed/cchess_alphazero/agent/api.py", line 50, in predict_batch_worker
while pipe.poll():
File "/usr/lib/python3.5/multiprocessing/connection.py", line 255, in poll
self._check_closed()
File "/usr/lib/python3.5/multiprocessing/connection.py", line 136, in _check_closed
raise OSError("handle is closed")
OSError: handle is closed

it's looks like a thread problem, but i don't know how to slove it.

请使用 统一码 Unicode 进行编程

@NeymarL 你好:
编写".exe"、储存".txt"等相关文件的时候,建议使用 统一码 "Unicode"。
这样“**象棋零”在非中文操作系统之下运行,可以正常显示中文汉字菜单。
希望每个**软件企业、程序人员都能留意到这个细节,让中文软件可以通行全球,同英文拉丁字母并驾齐驱!
详请参阅 微软文章 支持统一码字符集可迁移性、百度百科 Unicode词条,为国际市场编程!
(也请大家推广周知)
非Unicode程序 运行时须借助 "微软AppLocale"(应用在地化)等 转码工具,且有漏洞不补,
甚而2016起,微软不再提供"AppLocale",似有抑制中文扩散的意图。

目前棋力如何呢

請問目前的棋力如何了呢 不知道你們有沒有聽說目前圍棋AI leelazero項目 是由一個老外寫的代碼 然後由廣大網友一起用家中電腦訓練的ai 目前已經劍指alphago以外的最強ai了! 建議你們也可以採用這種方式 在各大網站宣傳 支持!!

UI上的两个小建议

  1. 当前走的子没有着重显示,建议像其他棋软一样,在当前走的子和其之前的位置的四角各加一个标志
  2. 现在红黑方的位置是固定的,建议增加一个选项,使得人类方不论执红还是执黑都在棋盘的下方

Google跑不到谱

image
cchess_alphazero.worker.self_play INFO # Exception Shape must be rank 1 but is rank 0 for 'input_batchnorm_4/cond/Reshape_4' (op: 'Reshape') with input shapes: [1,192,1,1], []., 重新加载权重
2018-11-07 10:16:32,709@cchess_alphazero.agent.model DEBUG # loading model from /content/ChineseChess-AlphaZero/data/model/model_192x10_config.json 不断跳出这种信息

希望作者更新bestmodel

在cczero.org已经有了接近462万局的棋谱,而最新的bestmodel已训练对局仅有3704489,希望作者更新bestmodel

【请教】请教实现细节

非常感谢作者优秀项目!

这边有几个实现细节请教作者(可以看源码,原谅我偷个懒)
(1)象棋的棋盘状态的编码方式(输入)
(2)输出的具体编码格式

再次感谢

How to use sl to achieve "faster training"?

@NeymarL 大神,excellent work, and very nice and clean code! Best Chinese chess repo I've ever seen.

Questions regarding training:

  1. Could you elaborate on how to use the supervised learning worker to accelerate training procedure?
  2. How do you crawl training data from onegreen? Can you share some experience / tips?

Since your server is down (any possibility to be back on again?), I am planning to explore training locally and see if I can get a better model

训练的问题

您好,我想请问一下,训练的时候,在actions, visits = zip(*actions_visits)这一步会产生很多0,然后后面取log就会报错,这个应该怎么处理呢?

mac selfplay 每步很慢,需要几十秒

mac 10.13.3
python run.py --type distribute --distributed self

distribute.py:
class PlayConfig:
def init(self):
self.max_processes = 1 # tune this to your cpu cores
self.search_threads = 10 # increase this will be faster but with weaker performance

agent/player.py line 179: self.all_done.acquire(True)
发现这里每次调用时间很长,几百ms。
去掉该调用之后,发现以下错误。走几步之后程序会退出。

2018-12-03 18:30:51,787@cchess_alphazero.worker.self_play MainThread ERROR # No chessman in 0010, state = rkemsmer1/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/1REMSMEKR, no_act = [], policy = [nan, ... nan]

请问这个all_done.acquire 是用来同步 MCTS_search 搜索状态的么?

File not found

running python3 cchess_alphazero/run.py play yields:
FileNotFoundError: [Errno 2] No such file or directory: '/home/m/miscel/ChineseChess-AlphaZero/cchess_alphazero/play_games/PingFang.ttc'
and a blank screen.
OS: ubuntu 18.04
python version: 3.7.5

APV-MCTS和Virtual Loss在哪里

RT。
想学习一下异步树搜索的写法,请问在哪个文件里呢?以及作者博客里说使用了多线程搜索,python的多线程貌似还是在单核上运行的,不知道是否有看到加速效果?

在gui界面进行运行参数控制与修改

Hi, NeymarL

能否修改一下GUI模块,在GUI界面上,游戏运行过程中,允许修改一些配置参数?比如在程序开启后再按钮选择人机对战/机器自动对弈,以及人先行棋还是AI先行棋,还有一些model运行的参数,比如simulation_num_per_move等等。

谢谢!

玩的时候总是卡住很长时间

python cchess_alphazero/run.py play
这个命令使用自带界面进行游戏,我先下,下完ai下,ai棋子都走完了,但是卡住很长很长时间,后台在干什么呢?

能否将selfplay的默认线程从20改为2?

过多的线程并行计算会影响MCTS的质量 在LZ中他们曾经采用的是1线程和2线程 如果这个对速度损失不太大的话 我觉得有必要做这个修改来提高训练的MCTS质量 同时希望UCI引擎也引入T参数设置 而不是卡死在20

Cannot Download CPU版本 GPU版本

Hi I cannot download CPU版本 or GPU版本 because I live in the US. Can you please upload it to somewhere else? I cannot register on Baidu; I cannot receive the text messages.

关于学习率和搜索效率的问题和建议

(1)现在大概训练了三四百万局,请问学习率是如何调的呢?是通过观察棋力增长曲线(趋于平缓时lr除以10),还是有别的方法?

(2)关于搜索树,我看到repo里用到了多线程,不太好确定这样做的效率,我会去跑一遍试一下。
我注意到FaceBook的ELF OpenGo是这样做的:一块卡上跑32个进程(也就是同时跑32局),每个进程里的搜索树每次攒4个叶子节点(这4个叶子对应的局面等待神经网络的evaluation),32个进程的128个局面一起送到神经网络里,这样就形成了batchsize=128的效果。感觉这种做法相当高效。
是否可以考虑实现ELF的做法?毕竟AGZ系的算法,self-play运行效率太重要。。。

怎么在linux下跑谱?

我下载了代码到linux虚拟机,然后跑谱遇到错误,怎么处理?

$ python ChineseChess-AlphaZero/colaboratory/run.py
File "ChineseChess-AlphaZero/colaboratory/run.py", line 28
config.internet.upload_url = f'{config.internet.base_url}/api/upload_game_file/128x7'
^
SyntaxError: invalid syntax

棋子走法

作者有考虑修改棋子走法的架构吗?改成bitboard位棋盘查找走法,判定攻击等等。这样可以快多少呢?每步蒙特卡洛搜索未出现局面肯定也要用到吧。

real-time win rate

Hi, I'd like to add the GUI to display the real-time win rate every time when I move in chess. Could you please tell me if there are some parameters related to the real-time win rate? Thank you very much!

Google Colaboratory下载权重有点小慢

一直报超时
2018-04-24 17:53:19,815@cchess_alphazero.agent.api INFO # 正在下载最新权重,请稍后...
model_best_weight.h5: 0%| | 0.00/10.5M [00:00<?, ?B/s]2018-04-24 17:53:20,[email protected] DEBUG # Starting new HTTP connection (1): download.52coding.com.cn
2018-04-24 17:53:21,[email protected] DEBUG # http://download.52coding.com.cn:80 "GET /128x7/model_best_weight.h5 HTTP/1.1" 206 10495712
model_best_weight.h5: 20%|███▏ | 2.10M/10.5M [01:03<04:14, 33.0kB/s]
2018-04-24 17:54:24,098@cchess_alphazero.agent.api INFO # 权重下载完毕!开始训练...
2018-04-24 17:54:24,099@cchess_alphazero.agent.model DEBUG # loading model from /content/ChineseChess-AlphaZero/data/model/model_best_config.json
2018-04-24 17:54:29,858@cchess_alphazero.agent.api ERROR # 加载权重发生错误:Unable to open file (truncated file: eof = 2096464, sblock->base_addr = 0, stored_eoa = 10495712),稍后重新下载
2018-04-24 17:54:29,[email protected] DEBUG # Starting new HTTP connection (1): alphazero.52coding.com.cn
2018-04-24 17:54:30,[email protected] DEBUG # http://alphazero.52coding.com.cn:80 "GET /api/get_latest_digest/128x7 HTTP/1.1" 200 None
2018-04-24 17:54:30,520@cchess_alphazero.agent.api INFO # 正在下载最新权重,请稍后...
model_best_weight.h5: 0%| | 0.00/10.5M [00:00<?, ?B/s]2018-04-24 17:54:31,[email protected] DEBUG # Starting new HTTP connection (1): download.52coding.com.cn
2018-04-24 17:54:31,[email protected] DEBUG # http://download.52coding.com.cn:80 "GET /128x7/model_best_weight.h5 HTTP/1.1" 206 10495712
model_best_weight.h5: 40%|██████▍ | 4.19M/10.5M [01:46<07:53, 13.3kB/s]
2018-04-24 17:56:17,240@cchess_alphazero.agent.api INFO # 权重下载完毕!开始训练...
2018-04-24 17:56:17,240@cchess_alphazero.agent.model DEBUG # loading model from /content/ChineseChess-AlphaZero/data/model/model_best_config.json
2018-04-24 17:56:24,820@cchess_alphazero.agent.api ERROR # 加载权重发生错误:Unable to open file (truncated file: eof = 4193408, sblock->base_addr = 0, stored_eoa = 10495712),稍后重新下载
2018-04-24 17:56:24,[email protected] DEBUG # Starting new HTTP connection (1): alphazero.52coding.com.cn
2018-04-24 17:56:25,[email protected] DEBUG # http://alphazero.52coding.com.cn:80 "GET /api/get_latest_digest/128x7 HTTP/1.1" 200 None
2018-04-24 17:56:25,409@cchess_alphazero.agent.api INFO # 正在下载最新权重,请稍后...
model_best_weight.h5: 0%| | 0.00/10.5M [00:00<?, ?B/s]2018-04-24 17:57:30,[email protected] DEBUG # Starting new HTTP connection (1): download.52coding.com.cn
2018-04-24 17:57:31,[email protected] DEBUG # http://download.52coding.com.cn:80 "GET /128x7/model_best_weight.h5 HTTP/1.1" 206 10495712
model_best_weight.h5: 9%|█▌ | 982k/10.5M [00:20<44:07, 3.59kB/s]

Dirichlet Noise

Hello,

Are you sure the Dirichlet noise at a root node should be regenerated each time the node is searched? It's not clear to me from the bit in the paper:

Additional exploration is achieved by adding Dirichlet noise 
to the prior probabilities in the root node s0, specifically 
P(s, a) = (1 − ε)p_a + εη_a, where η ∼ Dir(0.03) and ε = 0.25; 
this noise ensures that  all moves may be tried, but the
 search may still overrule bad moves

but it seems like this is something you can do just one time in the root node, then keep the same noise for all 50 or 100 or 1600 searches.

Pingfang.ttc

你好,
我试图在你提供的网站上找一个PingFang.ttc文件,网站上面显示404 not found

Note: Before you start, you need to download/find a font file (.ttc) and rename it as PingFang.ttc, then put it into cchess_alphazero/play_games. I have removed the font file from this repo because it's too big, but you can download it from here.

请问有什么解决办法吗

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.