It is currently Mon Mar 18, 2024 10:09 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 520 posts ]  Go to page Previous  1 ... 9, 10, 11, 12, 13, 14, 15 ... 26  Next
Author Message
Offline
 Post subject: Re: New android app "BadukAI"
Post #221 Posted: Mon Nov 09, 2020 10:11 am 
Gosei
User avatar

Posts: 1348
Liked others: 202
Was liked: 203
in Sabaki, KataGo 1.6.1 with g65 network did not work. I tried it this way and that ...

Top
 Profile  
 
Offline
 Post subject: Re: New android app "BadukAI"
Post #222 Posted: Mon Nov 09, 2020 10:19 am 
Lives in sente

Posts: 757
Liked others: 114
Was liked: 916
Rank: maybe 2d
@And, you shouldn't want to use the g65 networks at all, even if you want weaker networks. Even if you get them to work, they won't support the right rulesets and features that the newer neural nets support.

Go here:
https://d3dndmfyhecmj0.cloudfront.net/g ... index.html

And click on the link "selfplayhistory" just below where it says "Full History of Self-Play Nets". You should see the entire history of nets from g170, starting all the way from the very first neural net following purely random play, going all the way to the final nets of the run. If you want weaker nets, try testing out some of the early nets in here.


This post by lightvector was liked by 2 people: And, go4thewin
Top
 Profile  
 
Offline
 Post subject: Re: New android app "BadukAI"
Post #223 Posted: Mon Nov 09, 2020 10:25 am 
Gosei
User avatar

Posts: 1348
Liked others: 202
Was liked: 203
wow! thanks!!! I thought that there were only two g170 6b!


This post by And was liked by: go4thewin
Top
 Profile  
 
Offline
 Post subject: Re: New android app "BadukAI"
Post #224 Posted: Mon Nov 09, 2020 10:32 am 
Gosei
User avatar

Posts: 1348
Liked others: 202
Was liked: 203
@lightvector

thanks again! connected 6b to KataGo 1.6.1! now I'll try with CS Zero!


This post by And was liked by: lightvector
Top
 Profile  
 
Offline
 Post subject: Re: New android app "BadukAI"
Post #225 Posted: Mon Nov 09, 2020 2:52 pm 
Lives with ko

Posts: 172
Liked others: 13
Was liked: 151
go4thewin wrote:
@akigo
edit: nevermind, guess everything comes from ai.py. it seems to use the policy output though?
Do you have to add or remove any lines to ai.py to get it to work in android, or is self contained? Thanks!


ai.py contains several bot types, I only extracted the parts that are relevant for the kyu-rank bot. It is not self-contained as it uses data like "board state" and "policy values" which come from outside. Therefore I had to make some modifications to adapt this to the environment of BadukAI.

This also means that you can't "run" it stand-alone.

As for android, generally speaking it's no problem to run python code on android. There are python interpreters for android which you can feed the same python sources as on windows or linux (at least if they don't involve too specific OS interaction).


This post by akigo was liked by: go4thewin
Top
 Profile  
 
Offline
 Post subject: Re: New android app "BadukAI"
Post #226 Posted: Tue Nov 10, 2020 5:48 am 
Lives with ko

Posts: 150
Liked others: 200
Was liked: 30
Rank: 25 kyu
@akigo
Thanks for the time and clear explanation. Is it easy to get Baduk Ai to read txt.gz nets? I know its a minor inconvenience, but i was playing an older g170 6b net (s114), and the net plays more human like (plays some openings on star points, and other things) than the newest 6b net. The 1 playout policy still is strong (>gtp4zen6 1 dan). Might not be possible, but thought I'd try!


This post by go4thewin was liked by: And
Top
 Profile  
 
Offline
 Post subject: Re: New android app "BadukAI"
Post #227 Posted: Tue Nov 10, 2020 7:20 am 
Gosei
User avatar

Posts: 1348
Liked others: 202
Was liked: 203
network g170 6 block d7.09M probably plays on 2k.
this network 1p - CS Zero 1k 0:2
this network 1p - CS Zero 2k 2:0
this network 1p - gtp4zen 1k (Zen7 -t4 -s1600 -n1 -o1.6 -p0.3) 1:9

I played a little - this is a completely different game compared to 2k katrain !!!


This post by And was liked by: go4thewin
Top
 Profile  
 
Offline
 Post subject: Re: New android app "BadukAI"
Post #228 Posted: Tue Nov 10, 2020 7:43 am 
Gosei
User avatar

Posts: 1348
Liked others: 202
Was liked: 203
go4thewin wrote:
Is it easy to get Baduk Ai to read txt.gz nets?

yes it will be very good! playing with katrain kyu-rank is not even interesting :)

Top
 Profile  
 
Offline
 Post subject: Re: New android app "BadukAI"
Post #229 Posted: Tue Nov 10, 2020 8:10 am 
Gosei
User avatar

Posts: 1348
Liked others: 202
Was liked: 203
@lightvector

maybe there is a script to convert network.txt to .bin?

Top
 Profile  
 
Offline
 Post subject: Re: New android app "BadukAI"
Post #230 Posted: Tue Nov 10, 2020 10:18 am 
Lives with ko

Posts: 150
Liked others: 200
Was liked: 30
Rank: 25 kyu
I tried converting model.txt to a bin file using binary viewer https://www.proxoft.com/BinaryViewer.aspx and then gzipping the bin file to bin.gz, but didn't work for me in sabaki.

Top
 Profile  
 
Offline
 Post subject: Re: New android app "BadukAI"
Post #231 Posted: Tue Nov 10, 2020 10:35 am 
Gosei
User avatar

Posts: 1348
Liked others: 202
Was liked: 203
bin file contains data for various purposes, some in decimal form, but how the weights are stacked is a mystery :)


This post by And was liked by: go4thewin
Top
 Profile  
 
Offline
 Post subject: Re: New android app "BadukAI"
Post #232 Posted: Tue Nov 10, 2020 12:46 pm 
Lives in sente

Posts: 757
Liked others: 114
Was liked: 916
Rank: maybe 2d
You could always dig through the KataGo source code and see what the format it's expecting is. It's no mystery, the code is all there. :razz:

There are two ways to get a .bin.gz format. The first way is to export the original tensorflow weights again. Both the .bin.gz and .txt.gz are produced from the tensorflow weights, originally. You can download the tensorflow weights from the exact same site - it's the "saved_model" directory within the same zip file. You'll need to have tensorflow 1.15 installed and run a command like

Code:
python3 export_model.py -saved-model-dir /path/to/saved_model -export-dir /path/to/write/the/result -model-name NAME_OF_MODEL(like "g170-...") -name-scope "swa_model" -filename-prefix model -for-cuda


Where export_model.py is https://github.com/lightvector/KataGo/b ... t_model.py. Replace the arguments to -saved-model-dir and -export-dir and -model-name with the correct things.

The second way is to manually do the conversion yourself. There's no script yet, but the format is straightforward, so you could write won if you wanted. In the .txt format you'll see periodically a huge chunk of floating point values. Followed by a little more metadata, and another huge chunk of floating point values, and so on.

The .bin format is exactly the same except every time there's a huge chunk of floats, instead of writing out the floats in text, it goes "@BIN@" and then followed by all of the bytes of the floats in raw binary (little endian). Un-gzip both files and open them in notepad or notepad++ or something, and you can compare. You can see the code that writes them here: https://github.com/lightvector/KataGo/b ... el.py#L135

So you would have to write a script that every time it encounters a line containing a big block of floats, it parses all of them and outputs raw bytes, and it also writes "@BIN@" at the start of the line. Anything that isn't a big block of floats (like a line containing a string, or a line with a single integer value), it just outputs that line unchanged.

(edit: fixed typo tensorflow 1.5 -> 1.15)


Last edited by lightvector on Tue Nov 10, 2020 3:43 pm, edited 1 time in total.

This post by lightvector was liked by 2 people: And, go4thewin
Top
 Profile  
 
Offline
 Post subject: Re: New android app "BadukAI"
Post #233 Posted: Tue Nov 10, 2020 2:16 pm 
Lives with ko

Posts: 150
Liked others: 200
Was liked: 30
Rank: 25 kyu
@lightvector This is great, thanks so much.
I installed tensorflow 1.5, downloaded export_model.py in the saved_model folde and ran the following command
Code:
python export_model.py -saved-model-dir C:\Users\Go4thewin\Downloads\b6c96-s114663168-d17072879\b6c96-s114663168-d17072879\saved_model -export-dir C:\Users\Go4thewin\Downloads\b6c96-s114663168-d17072879\b6c96-s114663168-d17072879\ -model-name b6c96-s114663168-d17072879 -name-scope "swa_model" -filename-prefix model


then I get the following result in the command line
Code:
   filename_prefix: model
Building model
Traceback (most recent call last):
  File "export_model.py", line 60, in <module>
    with tf.compat.v1.variable_scope(name_scope):
AttributeError: module 'tensorflow.python.util.compat' has no attribute 'v1'


If anyone can help me with what I did wrong, it would be much appreciated. Only if I'm typing something wrong. If it's a technical error, then no problem. Thanks! I think this net is around time parity with gtp4zen 6, except maybe weaker than the very strongest (7d) rank.


Last edited by go4thewin on Thu Nov 12, 2020 7:39 am, edited 3 times in total.
Top
 Profile  
 
Offline
 Post subject: Re: New android app "BadukAI"
Post #234 Posted: Tue Nov 10, 2020 3:15 pm 
Lives with ko

Posts: 172
Liked others: 13
Was liked: 151
go4thewin wrote:
@akigo
Thanks for the time and clear explanation. Is it easy to get Baduk Ai to read txt.gz nets? I know its a minor inconvenience, but i was playing an older g170 6b net (s114), and the net plays more human like (plays some openings on star points, and other things) than the newest 6b net. The 1 playout policy still is strong (>gtp4zen6 1 dan). Might not be possible, but thought I'd try!


I think I can add that in the next version, but I have another feature "in progress", therefore I can't release anything at the moment. So please have some patience.


This post by akigo was liked by: go4thewin
Top
 Profile  
 
Offline
 Post subject: Re: New android app "BadukAI"
Post #235 Posted: Tue Nov 10, 2020 3:44 pm 
Lives in sente

Posts: 757
Liked others: 114
Was liked: 916
Rank: maybe 2d
go4thewin wrote:
If anyone can help me with what I did wrong, it would be much appreciated. Only if I'm typing something wrong. If it's a technical error, then no problem. Thanks! I think this net is around time parity with gtp4zen 6, except maybe weaker than the very strongest (7d) rank.


I typoed my post - you need tensorflow 1.15, not 1.5. (hence the error you got - about versions and "compat"ibility).


This post by lightvector was liked by: go4thewin
Top
 Profile  
 
Offline
 Post subject: Re: New android app "BadukAI"
Post #236 Posted: Wed Nov 11, 2020 4:11 pm 
Lives with ko

Posts: 172
Liked others: 13
Was liked: 151
I made a new version (0.17) which also loads .txt.gz KataGo models.


This post by akigo was liked by 2 people: And, go4thewin
Top
 Profile  
 
Offline
 Post subject: Re: New android app "BadukAI"
Post #237 Posted: Thu Nov 12, 2020 5:05 am 
Gosei
User avatar

Posts: 1348
Liked others: 202
Was liked: 203
new KaTrain will probably be much better than kyu-rank:

1.5.1 Pre-release: Experimental simple style AIs https://github.com/sanderland/katrain/releases
"Specifically it includes some AI options that are intended to play in a 'simple' way, but still leverage the full power of KataGo, avoiding some of the blind spots that the policy based AIs have."

Top
 Profile  
 
Offline
 Post subject: Re: New android app "BadukAI"
Post #238 Posted: Thu Nov 12, 2020 7:36 am 
Lives with ko

Posts: 150
Liked others: 200
Was liked: 30
Rank: 25 kyu
akigo wrote:
I made a new version (0.17) which also loads .txt.gz KataGo models.

Really love this app now. from the older s114 6b net kyu rank 7 to 4 threads 100 visits is a huge range of difficulty levels all the way up to mid dan, and makes fast moves even on older phones/tablets. the policy net and above are all very human like, and all the difficulty levels are really fun to play against.
this is an amazon review from a Japanese 4 dan of the zen6 5 dan bot that the katago net can beat

"It is a stringent and dependable master.
Reviewed in Japan on February 19, 2017
Verified Purchase
For amateur four dan me, at first it seemed ruthless, ruthless, killer. (My game in black number 4 stage, Zenith in white five dan)
Over the past month, repeated consecutive defeat, rejections, was held recently in the Go tournament of the same club held, suddenly became the third place, whats the goods.
Members have praised that people have become stronger as they have changed. Now it seems like a reliable master. It is so humanity as well.
The included learning software is also fun.
In the near future, we will defeat the zenith and give back , It is determined. But I'm worried about getting so strong and losing my friends."
I have the same worries as him with Baduk Ai, but oh well lol


Attachments:
File comment: zen6 5 dan was windows zen 6 application, not gtp4zen. 6b was s114 4 threads 100 max visits
6bs114t4visit100VSzen65dan.sgf [1.48 KiB]
Downloaded 280 times
Top
 Profile  
 
Offline
 Post subject: Re: New android app "BadukAI"
Post #239 Posted: Wed Nov 18, 2020 9:26 am 
Gosei
User avatar

Posts: 1348
Liked others: 202
Was liked: 203
KaTrain simple style(2d) - CS Zero 2d 2:0 (B+R, W+R)
KaTrain simple style(2d) - CS Zero 3d 2:0 (B+R, W+R)
KaTrain simple style(2d) - CS Zero 4d 2:0 (B+R, W+R)

Top
 Profile  
 
Offline
 Post subject: Re: New android app "BadukAI"
Post #240 Posted: Thu Nov 19, 2020 6:30 am 
Gosei
User avatar

Posts: 1348
Liked others: 202
Was liked: 203
KaTrain simple style(2d) - CS Zero 7d 1:1 (B+, B+)
KaTrain simple style(2d) - CS Zero 8d 1:1 (B+, B+)


Attachments:
katrain - cs zero.sgf [1.58 KiB]
Downloaded 644 times
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 520 posts ]  Go to page Previous  1 ... 9, 10, 11, 12, 13, 14, 15 ... 26  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group