Skip to content

Instantly share code, notes, and snippets.

View lnshi's full-sized avatar
🦀
Who am i...

Leonard Shi lnshi

🦀
Who am i...
View GitHub Profile
@lnshi
lnshi / tensorflow_cpu_m1_darwin_arm64_rust.md
Created March 26, 2022 04:59
Build TensorFlow C library on Apple M1 (darwin_arm64) and use it with TensorFlow rust bindings

Background

Currently if you try to use the TensorFlow rust bindings crate: tensorflow = "0.17.0", this crate's sub-crate: tensorflow-sys will try to build the underlying TensorFlow C library from the source as Google hasn't provided an official release for Apple M1, but unfortunately the building will fail.

This gist provides a full working instructions for you to build the TensorFlow C library on Apple M1 (darwin_arm64), and eventually use it with the TensorFlow rust bindings crate: tensorflow = "0.17.0".

This gist was tested on TensorFlow v2.8.0, the other versions should work in the same way.

Steps