-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Net-to-CoreML Conversion Script #222
base: master
Are you sure you want to change the base?
Conversation
This commit introduces the `net_to_coreml.py` script in the `tf/` directory. The script facilitates the conversion of a neural network file into a TensorFlow model, followed by its transformation into a CoreML model. This process mirrors the TensorFlow model conversion methodology used in `net_to_model.py`. Key features of the CoreML conversion include: - Setting the input shape to (1, 112, 8, 8). - Defining `input_planes` as the input name. - Specifying output names as `output_policy`, `output_value`, and `output_moves_left`. - Assigning a concise description to the model, formatted as `Lc0 converted from {net name}`. The script concludes by saving the CoreML model as `{net name}.mlpackage`. This enhancement enables the conversion of neural networks into CoreML models, which can be executed using Apple's Neural Engine. Future development of the CoreML backend is planned within the `lc0` repository.
Regarding with the
I am running |
Test 2: 512x19 (PASSED)
The |
Modify TFProcess init_net method to accept an argument for including attention weights in the output, and update construct_net method to conditionally include attention weights in the outputs list. This enables flexibility in specifying whether to include attention weights in the model outputs.
Consolidate net-to-model conversion in a separate function to enhance modularity and reduce repeated code.
Modify conversion routines to enable rescaling option for Rule50 inputs, ensuring compatibility with client expectations. This paves the way for improved model adaptation.
Enable specifying compute precision (e.g., FLOAT16) for CoreML model conversion, offering increased flexibility in choosing the precision, thus potentially optimizing model performance.
Unable to convert the |
This commit introduces the
net_to_coreml.py
script in thetf/
directory. The script facilitates the conversion of a neural network file into a TensorFlow model, followed by its transformation into a CoreML model. This process mirrors the TensorFlow model conversion methodology used innet_to_model.py
.Key features of the CoreML conversion include:
input_planes
as the input name.output_policy
,output_value
, andoutput_moves_left
.Lc0 converted from {net name}
. The script concludes by saving the CoreML model as{net name}.mlpackage
. This enhancement enables the conversion of neural networks into CoreML models, which can be executed using Apple's Neural Engine. Future development of the CoreML backend is planned within thelc0
repository.Test 1: 128x10 (PASS)
Test 2: 512x19 (FAILED)
The error message is similar with this issue. apple/coremltools#1768