kaorahi / lizgoban

Leela Zero & KataGo visualizer
GNU General Public License v3.0
169 stars 28 forks source link

HOW TO UPDATE TO USE LATEST KATAGO NETWORK/WEIGHTS? #85

Closed mathwo closed 1 year ago

mathwo commented 1 year ago

I am still learning about the details but it seems to me that lizgoban is using an old and build-in version of katago network file that is not compatible with latest katago network files any more. And I tried to update weights from menu of lizgoban but failed. The documentation is not clear how to set config for it.

So the question and issue is: HOW TO UPDATE TO USE LATEST KATAGO NETWORK/WEIGHTS?

kaorahi commented 1 year ago

As you say, the built-in KataGo (1.11.0) is outdated in LizGoban 0.7.0. I am planning to release updated LizGoban in a few weeks.

In the meantime, you can use the latest version of KataGo with LizGoban 0.7.0 as follows. (see "To customize it on 64bit Windows" in the release note)

  1. Download KataGo zip from the release page and unzip it.
  2. Download KataGo network from the networks page.
  3. Place the config.json file in the same folder as LizGoban 0.7.0.exe.

The contents of config.json:

{
    "preset": [
        {
            "label": "KataGo",
            "engine": ["/XXX/XXX/katago.exe", "gtp",
                       "-override-config",
                       "analysisPVLen=50, defaultBoardSize=19, homeDataDir=., logAllGTPCommunication=false, logSearchInfo=false",
                       "-model", "/YYY/YYY/kata1-b18c384nbt-s5832081920-d3223508649.bin.gz"]
        }
    ]
}

You need to replace /XXX/XXX and /YYY/YYY with the actual paths to where you placed them. (Maybe C:/...? I am not familiar with Windows.)

Here is also a longer version of config.json if you like.

{
    "max_cached_engines": 2,
    "face_image_rule": [
        [-0.8, "goisi_k4.png", "goisi_s4.png"],
        [-0.4, "goisi_k8.png", "goisi_s8.png"],
        [0.00, "goisi_k7.png", "goisi_s7.png"],
        [0.30, "goisi_k11.png", "goisi_s11.png"],
        [0.90, "goisi_k10.png", "goisi_s10.png"],
        [1.00, "goisi_k16.png", "goisi_s16.png"]
    ],
    "face_image_diff_rule": [
        [-1.0, "goisi_k15.png", "goisi_s15.png"],
        [-0.5, "goisi_k9.png", "goisi_s9.png"],
        [0.50, null, null],
        [1.00, "goisi_k5.png", "goisi_s5.png"],
        [2.00, "goisi_k14.png", "goisi_s14.png"]
    ],
    "preset": [
        {
            "label": "KataGo (custom)",
            "engine": ["/XXX/XXX/katago.exe", "gtp",
                       "-override-config",
                       "analysisPVLen=50, defaultBoardSize=19, homeDataDir=., logAllGTPCommunication=false, logSearchInfo=false",
                       "-model", "/YYY/YYY/kata1-b18c384nbt-s5832081920-d3223508649.bin.gz"]
        },
        {
            "label": "KataGo (CPU)",
            "accelerator": "F1",
            "engine": [["built-in", "katago/katago-eigen"], "gtp",
                       "-override-config",
                       "analysisPVLen=50, defaultBoardSize=19, homeDataDir=., logAllGTPCommunication=false, logSearchInfo=false",
                       "-model", ["built-in", "katanetwork.gz"]]
        },
        {
            "label": "KataGo (modern CPU)",
            "accelerator": "F2",
            "engine": [["built-in", "katago/katago-eigenavx2"], "gtp",
                       "-override-config",
                       "analysisPVLen=50, defaultBoardSize=19, homeDataDir=., logAllGTPCommunication=false, logSearchInfo=false",
                       "-model", ["built-in", "katanetwork.gz"]]
        },
        {
            "label": "KataGo (GPU)",
            "accelerator": "F3",
            "engine": [["built-in", "katago/katago-opencl"], "gtp",
                       "-override-config",
                       "analysisPVLen=50, defaultBoardSize=19, homeDataDir=., logAllGTPCommunication=false, logSearchInfo=false",
                       "-model", ["built-in", "katanetwork.gz"]]
        }
    ]
}
kaorahi commented 1 year ago

I released 0.8.0-pre1 with KataGo 1.12.4. Config files are also added in it so that you can replace katago and/or its network more easily. See its README.