tensorflow / minigo

An open-source implementation of the AlphaGoZero algorithm
Apache License 2.0
3.47k stars 561 forks source link

Looking for 9x9 model files in .minigo file format #989

Closed walmsley closed 4 years ago

walmsley commented 4 years ago

I'm looking to run a 9x9 model in MiniGo's C++ GTP program, and it seems as though the program only accepts the new .minigo file format.

I've found 9x9 model files at e.g. https://console.cloud.google.com/storage/browser/minigo-pub/v3-9x9/models/?prefix=000427 but the only file formats provided are .meta, .index, and .data-* files. Do .pb or .minigo files exist somewhere for these models? Otherwise, are there instructions somewhere on how to properly convert these files to a .minigo file format?

Thanks!

sethtroisi commented 4 years ago

It doesn't seem that we have converted the old 9x9 models.

@tommadams or I will try to do.

@tommadams is this the general jist

for MODEL_PATH in `gsutil ls ...` do
  python freeze_graph.py  --model_path=$MODEL_PATH
  python3 oneoffs/wrap_model.py \
    --src_path $MODEL_PATH.tflite \
    --dst_path $MODEL_PATH.minigo \
  --metadata engine=lite,input_features=agz,input_layout=nhwc,input_type=float,board_size=9
done

note there's a small typo in cc/README.md see s/minifo/minigo/

tommadams commented 4 years ago

I'll do this now

tommadams commented 4 years ago

Oh, it looks like we don't have frozen .pbs for those 9x9 models.

We'll need to freeze them. Does anyone know what the architecture flags used were?

sethtroisi commented 4 years ago

That's a question for @amj or @brilee

brilee commented 4 years ago

I don't recall that our old 9x9 model were even that good. Tom, didn't you spend some time MLPerf'ing some 9x9 runs? Those might be better if you leave it running for a day or two, and it'll spit out the right file format without any extra grungework.

On Thu, Apr 23, 2020 at 5:47 AM Seth Troisi notifications@github.com wrote:

That's a question for @amj https://github.com/amj or @brilee https://github.com/brilee

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tensorflow/minigo/issues/989#issuecomment-618300808, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKCKFSMTT7L76QKXX3G4BTROAFCHANCNFSM4MONXAKA .

tommadams commented 4 years ago

I'm digging through the github history to see if I can pull out the appropriate architecture flags.

The v0.6 MLPerf was 9x9 but the benchmark was set up to train a model that plays something "reasonable" in as short a time as possible. The trained models are pretty weak.

tommadams commented 4 years ago

Ok, I've uploaded .minigo versions of all the v3-9x9 models to the GCS bucket.

When you're building the C++ binaries, remember to pass --define=board_size=9 because the board size is a compile-time constant. For example:

gsutil cp gs://minigo-pub/v3-9x9/models/000496-polite-ray.minigo .
bazel build  -c opt  --define=board_size=9  cc:simple_example
./bazel-bin/cc/simple_example  --model=000496-polite-ray.minigo