lightvector / KataGo

GTP engine and self-play learning in Go
https://katagotraining.org/
Other
3.47k stars 563 forks source link

If I only want to use your trained file then need I compile all of the code? #310

Open mcguu opened 4 years ago

mcguu commented 4 years ago

If I do not want to train the model but only want to use the model you trained since your computer and nvidia is very high quality.

the bin file can I use directly?

for example there is some steps the two players already go. and I input the positions which the players put in .and can get the next step of the play.

is it the bin file you trained tensor-flow or other files? how to read and use them?

lightvector commented 4 years ago

If you know how to use the command line and how file paths work, then:

Download appropriate version from here and unzip: https://github.com/lightvector/KataGo/releases/tag/v1.6.1 Download .bin.gz for what neural net you want from here: https://github.com/lightvector/KataGo/releases/tag/v1.4.5 Follow instructions here: https://github.com/lightvector/KataGo#how-to-use Download your favorite other GUI program (Lizzie, or whatever) and follow its instructions for attaching Go engines, attach KataGo to it.

If you don't know how the command line and file paths and work very well, then install this: https://github.com/sanderland/katrain and it will do most of the configuration and download of KataGo and the neural network models for you via some reasonable defaults.

mcguu commented 4 years ago

If I want to write a gui program so I have to read all the codes?

I want to write a simple gui program which can search the .bin.gz file to get the best steps which player can go.

It just as a helper program which suggest the next steps to go.

lightvector commented 4 years ago

If you're trying to write your own GUI, please read the documentation for this: https://github.com/lightvector/KataGo/blob/master/docs/Analysis_Engine.md

Communicate via JSON over stdout and stdin to request analysis of different board positions.

mcguu commented 4 years ago

thank you @lightvector you are very patient to explain my questions.

besides I only want to use your .bin.gz and do not want to use the other codes such as cuda or opencl. it is not necessary, right?

it might be ok that I input the player's go and get the answers from your .bin.gz file?

can you tell me how to read it? not use the queries?

lightvector commented 4 years ago

No, too much work to read the .bin.gz yourself. Just use the analysis engine please. :)

If you want to only get the raw values from the neural net you can still just use the analysis engine and tell KataGo to use 1 visit only. But keep in mind 1 visit will NOT be as strong as doing a search using KataGo's full engine! The raw neural net may easily make major blunders and is probably NOT professional human level, so it's not good for analysis, only for research purposes where you specifically want to study how the net itself behaves.

And if the problem is that you just don't want to figure out CUDA or OpenCL, maybe you don't have a GPU, then just use the Eigen version.

mcguu commented 4 years ago

actually I want to make it work on a mobile so that my team can use it anytime and anywhere.

as you know many mobile does not have a CUDA.

and is there any plan to compile the engine to swift or kotlin? or a library that can be used in the swift or kotlin?

lightvector commented 4 years ago

Eigen is just CPU. Does that work on mobile?

mcguu commented 4 years ago

yes it can work on mobile. where is the docs to use Eigen? I am very excited.

lightvector commented 4 years ago

It's the same docs. Use either GTP which all Go programs support and where KataGo is no different. Or use the analysis engine which is documented on the page I linked you.

Compile KataGo as instructed on the main github page readme https://github.com/lightvector/KataGo using the Eigen backend after you have obtained all necessary libraries and dependencies. Possibly you will have to improvise and change things in order to work for mobile, since I have never compiled KataGo or any of the libraries it depends on for mobile hardware, so I can't really help you there. You'll have to figure it out. If you run into specific issues, or you need any specific changes in KataGo's code to support things, then go ahead and ask more, but please read the docs that are there first. :)

iopq commented 4 years ago

I suggest you try to get OpenCL to work on mobile, there are Leela Zero bots that do this with... differing success

mcguu commented 4 years ago

@iopq thank you for your reply. OpenCL now is available on mobile both android and ios.

But there is very heavy code.

I want to get the suggestion of next steps to play.

which means....... I give the data of the two players already play and get the next locations the engine suggest to play.

But I have to compile all of the code.