diff --git a/KataGo/OpenCL.dll b/KataGo/OpenCL.dll index 2c8d65d..ec4db0f 100644 Binary files a/KataGo/OpenCL.dll and b/KataGo/OpenCL.dll differ diff --git a/KataGo/boost_filesystem-vc142-mt-x64-1_72.dll b/KataGo/boost_filesystem-vc142-mt-x64-1_72.dll new file mode 100644 index 0000000..2d6950d Binary files /dev/null and b/KataGo/boost_filesystem-vc142-mt-x64-1_72.dll differ diff --git a/KataGo/katago-bs b/KataGo/katago-bs deleted file mode 100755 index d461551..0000000 Binary files a/KataGo/katago-bs and /dev/null differ diff --git a/KataGo/katago-bs.exe b/KataGo/katago-bs.exe deleted file mode 100644 index 47557ad..0000000 Binary files a/KataGo/katago-bs.exe and /dev/null differ diff --git a/KataGo/katago.exe b/KataGo/katago.exe index decdb4e..834a12b 100644 Binary files a/KataGo/katago.exe and b/KataGo/katago.exe differ diff --git a/KataGo/libz.dll b/KataGo/libz.dll deleted file mode 100644 index 831fa88..0000000 Binary files a/KataGo/libz.dll and /dev/null differ diff --git a/KataGo/libzip.dll b/KataGo/libzip.dll deleted file mode 100644 index c8bf586..0000000 Binary files a/KataGo/libzip.dll and /dev/null differ diff --git a/KataGo/zlib1.dll b/KataGo/zlib1.dll new file mode 100644 index 0000000..be705d8 Binary files /dev/null and b/KataGo/zlib1.dll differ diff --git a/README.md b/README.md index 50565dd..526da3d 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ but has since grown to include a wide range of features, including: ## Manual ### Play + Under the 'play' tab you can select who is playing black and white. * Human is simple play with potential feedback, but without auto-undo. * Teach will give you instant feedback, and auto-undo bad moves to give you a second chance. @@ -80,6 +81,7 @@ In short, if you are a weaker player you should mostly on large dots that are re while stronger players can pay more attention to smaller mistakes. #### AIs + Available AIs, with strength indicating an estimate for the default settings, are: * **[9p+]** **Default** is full KataGo, above professional level. @@ -115,7 +117,6 @@ Keyboard shortcuts are shown with **[key]**. * **[s]**: Equalize: Re-evaluate all currently shown next moves with the same visits as the current top move. Useful to increase confidence in the suggestions with high uncertainty. * **[d]**: Sweep: Evaluate all possible next moves. This can take a bit of time even though 'fast_visits' is used, but the result is nothing if not colourful. - ## Keyboard and mouse shortcuts In addition to shortcuts mentioned above, there are: @@ -136,7 +137,6 @@ In addition to shortcuts mentioned above, there are: * **[Ctrl-n]**: Load SGF from clipboard * **[space]**: Pass - ## Configuration Configuration is stored in `config.json`. Most settings are now available to edit in the program, but some advanced options are not. @@ -173,9 +173,12 @@ If you ever need to reset to the original settings, simply re-download the `conf * The first startup of KataGo can be slow due to GPU tuning, after that it should be much faster. * The program is running too slowly. How can I speed it up? * Adjust the number of visits or maximum time allowed in the settings. +* KataGo crashes with out of memory errors, how can I prevent this? + * Try using a lower number for `nnMaxBatchSize` in `KataGo/analysis_config.cfg`, and avoid using the board size 29 version. ## Contributing * Feedback and pull requests are both very welcome. * For suggestions and planned improvements, see the 'issues' tab on github. * You can also contact me on discord (Sander#3278) or [reddit](http://reddit.com/u/sanderbaduk) to give feedback, or simply show your appreciation. + diff --git a/bots/start_bot.py b/bots/start_bot.py index 996b5d1..137c043 100755 --- a/bots/start_bot.py +++ b/bots/start_bot.py @@ -15,7 +15,7 @@ if True or bot in ["dev", "local"]: else: GTP2OGS = "node ../stable-gtp2ogs" BOT_SETTINGS = f" --maxconnectedgames {MAXGAMES} --maxhandicapunranked 25 --maxhandicapranked 1 --boardsizesranked 19 --boardsizesunranked all --komisranked automatic,5.5,6.5,7.5 --komisunranked all" -if 'beta' in bot: +if "beta" in bot: BOT_SETTINGS += " --beta" else: BOT_SETTINGS += "" # --rankedonly" diff --git a/config.json b/config.json index ded6119..3734b1f 100644 --- a/config.json +++ b/config.json @@ -1,9 +1,9 @@ { "engine": { - "katago": "KataGo/katago-bs", + "katago": "KataGo/katago", "model": "KataGo/models/b15-1.3.2.txt.gz", "config": "KataGo/analysis_config.cfg", - "threads": 8, + "threads": 16, "max_visits": 500, "fast_visits": 50, "max_time": 3.0, diff --git a/core/sgf_parser.py b/core/sgf_parser.py index c3e59b9..390df6c 100644 --- a/core/sgf_parser.py +++ b/core/sgf_parser.py @@ -212,7 +212,7 @@ class SGFNode: @property def next_player(self): - if "B" in self.properties or "AB" in self.properties: # root or black moved + if "B" in self.properties or "AB" in self.properties: # root or black moved return "W" else: return "B" @@ -222,7 +222,7 @@ class SGFNode: if "B" in self.properties or "AB" in self.properties: return "B" else: - return "W" # nb root is considered white played if no handicap stones are placed + return "W" # nb root is considered white played if no handicap stones are placed class SGF: @@ -239,10 +239,10 @@ class SGF: if not encoding: match = re.search(rb"CA\[(.*?)\]", bin_contents) if match: - encoding = match[1].decode("ascii") + encoding = match[1].decode("ascii", errors="ignore") else: encoding = "ISO-8859-1" # default - decoded = bin_contents.decode(encoding=encoding) + decoded = bin_contents.decode(encoding=encoding, errors="ignore") return cls.parse(decoded) def __init__(self, contents): diff --git a/gui/popups.py b/gui/popups.py index 888d5d3..bb8d753 100644 --- a/gui/popups.py +++ b/gui/popups.py @@ -179,6 +179,7 @@ class ConfigPopup(QuickConfigGui): if not old_proc: self.katrain.game.analyze_all_nodes() # old engine was broken, so make sure we redo any failures self.katrain.update_state() + Clock.schedule_once(restart_engine, 0) self.katrain.debug_level = self.config["debug"]["level"] diff --git a/profile.py b/profile.py deleted file mode 100644 index a0a36c0..0000000 --- a/profile.py +++ /dev/null @@ -1,42 +0,0 @@ -# This is a stand-alone script that generates a review for an SGF -import json -import sys -import time - -from core.common import OUTPUT_INFO -from core.engine import KataGoEngine -from core.game import Game, KaTrainSGF - -if len(sys.argv) < 2: - exit(1) -inputfile = sys.argv[1] - -with open("config.json") as f: - settings = json.load(f) - sgf_settings = settings["sgf"] - engine_settings = settings["engine"] - game_settings = settings["game"] - trainer_settings = settings["trainer"] - -#engine_settings['threads'] = 32 -engine_settings["max_time"] = 1000 - -class Logger: - def log(self, msg, level): - if level <= OUTPUT_INFO: - print(msg) - - -logger = Logger() - -engine = KataGoEngine(logger, engine_settings) -move_tree = KaTrainSGF.parse_file(inputfile) -game = Game(logger, engine, game_settings, move_tree=None, analyze_fast=True) -game.root=move_tree -reverse_nodes = game.root.nodes_in_tree[::-1] - -for n in reverse_nodes[::10]: - n.analyze(engine=engine) - while not n.analysis_ready: - time.sleep(0.01) - print(n.single_move,'done') \ No newline at end of file diff --git a/review.py b/review.py deleted file mode 100644 index d6712cf..0000000 --- a/review.py +++ /dev/null @@ -1,49 +0,0 @@ -# This is a stand-alone script that generates a review for an SGF -import json -import sys -import time - -from core.common import OUTPUT_INFO -from core.engine import KataGoEngine -from core.game import Game, KaTrainSGF - -if len(sys.argv) < 2: - exit(1) -inputfile = sys.argv[1] - -with open("config.json") as f: - settings = json.load(f) - sgf_settings = settings["sgf"] - engine_settings = settings["engine"] - game_settings = settings["game"] - trainer_settings = settings["trainer"] - -engine_settings['threads'] = 16 -#engine_settings['katago'] = 'KataGo/katago-bs' -engine_settings["max_time"] = 1000 -engine_settings["max_visits"] = 50 - -class Logger: - def log(self, msg, level): - if level <= OUTPUT_INFO: - print(msg) - - -logger = Logger() - -engine = KataGoEngine(logger, engine_settings) -move_tree = KaTrainSGF.parse_file(inputfile) -game = Game(logger, engine, game_settings, move_tree=move_tree, analyze_fast=False) -nodes = game.root.nodes_in_tree -remaining = len(nodes) -while remaining > 0: - remaining = sum(not n.analysis_ready for n in nodes) - print(f"Waiting for {remaining} queries") - time.sleep(0.1) - -msg = game.write_sgf( - sgf_settings["sgf_save"], - trainer_config=trainer_settings, - save_feedback=sgf_settings["save_feedback"], - eval_thresholds=trainer_settings["eval_thresholds"], -)